How can I get the username from a failed login using spring security?

后端 未结 7 2267
情书的邮戳
情书的邮戳 2020-12-23 18:31

We\'re using spring security 3.0.5, Java 1.6 and Tomcat 6.0.32. In our .xml config file we\'ve got:



        
相关标签:
7条回答
  • 2020-12-23 19:14

    I have found this works for me. Unfortunately, I still not found the exact location of this in SpringSecurity documents:

    In any action, you can check the last-used username (no matter what the login was failed or not):

        String  username = (String) request.getSession().getAttribute("SPRING_SECURITY_LAST_USERNAME");
    
    0 讨论(0)
提交回复
热议问题