Results 1 to 6 of 6

Thread: Deep linking into CAS + acegi secured application

  1. #1
    Join Date
    Sep 2005
    Posts
    10

    Default Deep linking into CAS + acegi secured application

    My application needs to properly handle deep links when the user is logged into cas but not the application, but this is not working correctly. I can see where the AbstractProcessingFilter.ACEGI_SECURITY_TARGET_URL _KEY is being set in the session, but on the next request (after cas successfully authenticates,) the session value for that key is null in AbstractProcessingFilter.successfulAuthentication( ...)

    Am I missing somethig?

  2. #2
    Join Date
    Sep 2005
    Posts
    10

    Default more

    Seems the session ID is different for the initial request, and the request to j_acegi_cas_security_check, should these two requests be using the same session?

    (btw, I checked that I am not switching domains between the requests )

  3. #3
    Join Date
    Sep 2005
    Posts
    10

    Default

    Did some more investigation, seems like vanilla cas filtering without Acegi will show the same behavior - ie, sessionid is not the same after logging into cas as it was on the first (unauthenticated) request to the application.

    This is a pretty big gotcha. If the session is lost, I can't think of any other ways to preserve the as sending the initially requested url to CAS in the service parameter would require some significant mods to the ServiceProperties#getService() mechanism currently used.

    (I also tried putting in a filter before any others that sets a session attribute, then forces a browser refresh by meta tag. I did this in the hopes that the first session was getting dropped beacuse the response was a redirect, but it didn't help.)

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    I am not sure this is correct, as I've successfully authenticated to CAS and had the previous pre-authentication HttpSession preserved when I come back into the original application.

    Are you using URL-based ;jsessionid perhaps, and thus there is no client-side session cookie to persist the session ID?
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  5. #5
    Join Date
    Sep 2005
    Posts
    10

    Default

    I am not sure this is correct, as I've successfully authenticated to CAS and had the previous pre-authentication HttpSession preserved when I come back into the original application.
    I agree, its a wierd phenom, and it should just work, but it doesn't... at least not in my app. I saw the session changing with Acegi, and also with the cas-client filter (no spring, no acegi.) I thought it might be because the browser sees a redirect instead of a 200, so it misses the cookie, but when I replaced the redirect with a meta tag refresh, same behavior.

    ] Are you using URL-based ;jsessionid perhaps, and thus there is no client-side session cookie to persist the session ID?
    No I am just using vanilla sessions. I did consider using url rewrite ;jsessionid=whatever as a workaround, but realized I would need extensive code to pass the sessionid to all the way to the TicketValidator, as that needs to send a matching service url.

    My current workaround is subclassed CASProcessingFilter and CASProcessingFilterEntryPoint to set and read a cookie with the initial URL, and populate session attribute ACEGI_SECURITY_TARGET_URL_KEY after calling ProcessingFilter.attemptAuthentication(request); Interesting that this works, as it implies no problems with setting cookies... If more info comes to light I'll update this post, for now, the ugly hack is working.

  6. #6
    Join Date
    Nov 2008
    Posts
    1

    Default Same problem

    Hi all ,
    I also encountered the same problem , it is only for IE7 though (Firefox2 and Google Chrome works fine) , at least for my machine.

    I'm running CAS server 3.3 and Spring security 2.0.4 ...

    Any suggestion ?

    thanks,
    Owat
    Last edited by sysnajar; Nov 12th, 2008 at 03:19 PM. Reason: typo

Similar Threads

  1. Webservices + web application + swing - acegi
    By amit_shah25 in forum Security
    Replies: 3
    Last Post: Jun 26th, 2005, 09:13 PM
  2. Need help w. mod_jk2 acegi secured channel redirect
    By Brian Guan in forum Security
    Replies: 6
    Last Post: Jun 24th, 2005, 09:17 PM
  3. Use acegi in a standalone application
    By Tud in forum Security
    Replies: 4
    Last Post: Apr 8th, 2005, 06:39 PM
  4. Questioning the core component
    By Martin Kersten in forum Swing
    Replies: 6
    Last Post: Feb 21st, 2005, 03:45 AM
  5. Remote application using Burlap + ACEGI
    By Adventure in forum Security
    Replies: 1
    Last Post: Jan 27th, 2005, 07:00 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
  •