Announcement Announcement Module
No announcement yet.
Unable to get to invalid login page Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to get to invalid login page

    Hi everyone,

    I am trying to incorporate spring security. I have it working so that depending upon the username, the users sees various menu's.

    But when an incorrect login is entered, the user sees the "java.lang.IllegalArgumentException: A granted authority textual representation is required" error stacktrace.

    So my retrieveUser(String username, UsernamePasswordAuthenticationToken authenticationCreds) method returns null, if the username does not exist in the database.

    So how do I get a user to a custom invalid login page?

  • #2
    What does your stacktrace look like? The retrieveUser method looks to be custom...what does that class look like and how are you integrating it into Spring Security? If you are implementing a UserDetailsService or AuthenticationProvider, you should throw an AuthenticationException if the user is not found or has entered the incorrect password.

    PS: Why do you have username and a UsernamePasswordAuthenticationToken as arguments to can obtain the username from the token.