JavaConfiguration for Spring 4.0 + Security 3.2 + j_spring_security_check

后端 未结 1 523
心在旅途
心在旅途 2020-12-15 10:15
  1. Create a login page

    <%@ taglib prefix=\"c\" uri=\"http://java.sun.com/jsp/jstl/core\" %>
    
    
        
              
    
    
            
相关标签:
1条回答
  • 2020-12-15 11:02

    In 3.2 version post parameters have changed from j_username to username and j_password to password. The login url has also changed from /j_spring_security_check to /login.

    See this link for the explanation of why this change was implemented: http://docs.spring.io/spring-security/site/docs/3.2.0.RELEASE/reference/htmlsingle/#jc-httpsecurity. These are the changes:

    • GET /login renders the login page instead of /spring_security_login

    • POST /login authenticates the user instead of /j_spring_security_check

    • The username parameter defaults to username instead of j_username

    • The password parameter defaults to password instead of j_password

    And this for an example of a login form: http://docs.spring.io/spring-security/site/docs/3.2.0.RELEASE/reference/htmlsingle/#jc-form

    0 讨论(0)
提交回复
热议问题