Spring Security Login Page

前端 未结 2 848
被撕碎了的回忆
被撕碎了的回忆 2020-11-30 22:45

I developed an application that uses Spring Security\'s default login page. However I want to implement my own login page. I will put a login.html instead of a jsp page. I w

2条回答
  •  野性不改
    2020-11-30 23:07

    There are four requirements for a custom login page in Spring Security:

    1. There is an input field named j_username which will contain the name used for the authentication credentials.
    2. There is an input field named j_password which will contain the password used for the authentication credentials.
    3. The url to which these values are POSTed matches the url defined in the login-processing-url attribute of the form-login element in your Spring Security configuration.
    4. The location of the custom login form must be specified in the login-page attribute of the form-login element in your Spring Security configuration.

    Login.html

        
          

    Spring Security Configuration File

        
          
          
          
        
    

提交回复
热议问题