Announcement Announcement Module
Collapse
No announcement yet.
Choose a redirect based on the authentication? Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Choose a redirect based on the authentication?

    I've tried overriding

    AuthenticationProcessingFilter.onSuccessfulAuthent ication()

    with

    Code:
    request.getSession().setAttribute(ACEGI_SECURITY_TARGET_URL_KEY,customPage);
    but that doesn't seem to be doing anything. Has anyone done this before? Thanks!

  • #2
    Try using AuthenticationProcessingFilter.alwaysUseDefaultTar getUrl = true, and setting your preferred target URL with the AuthenticationProcessingFilter.defaultTargetUrl property.

    Comment


    • #3
      Well, I need to determine where to send the user after they log in. For example, admin goes to this page, user goes here, etc.

      I took a gander at the source, and it looks like onSuccessfulAuthentication is called after the target URL is determined, which is why my solution doesn't work. I think a method such as:

      String getRedirect(Authentication authResult)

      could be very handy, unless I'm the only one who needs that functionality. But lots of pages do this, right? I'll just add it myself for now. Shouldn't take more then an extra check in AbstractProcessingFilter.successfulAuthentication( )

      EDIT: I ended up just decorating successfulAuthentication. Worked like a charm.

      Comment

      Working...
      X