Results 1 to 3 of 3

Thread: Choose a redirect based on the authentication?

  1. #1

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

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

  3. #3

    Default

    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.

Similar Threads

  1. Replies: 2
    Last Post: Oct 13th, 2005, 02:47 PM
  2. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  3. Replies: 2
    Last Post: May 9th, 2005, 05:57 PM
  4. Replies: 8
    Last Post: Dec 7th, 2004, 06:13 PM
  5. Replies: 2
    Last Post: Nov 12th, 2004, 06:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •