Results 1 to 3 of 3

Thread: Problem getting SecurityContext using SecurityContextHolder

  1. #1
    Join Date
    Jul 2006
    Posts
    4

    Default Problem getting SecurityContext using SecurityContextHolder

    Hello,

    I am experiencing the following problem: after a successful login with ACEGI (using LDAP provider), I cannot access the newly SecurityContext using SescurityContextHolder.getSecurityContext() - the method returns null, but it works just fine if I get it from HTTP Session, by searching for the attribute HttpSessionContextIntegrationFilter.ACEGI_SECURITY _CONTEXT_KEY.

    Any idea? Am I missing a setting somewhere?
    If you need more details, let me know

    Thanks.

  2. #2
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    This should be impossible. SecurityContextHolder.getContext() is guaranteed not to return null.

  3. #3
    Join Date
    Jul 2006
    Posts
    4

    Default

    Actually, I made a mistake. The context is indeed not null, but the method getAuthentication, called on the context retrieved by using SecurityContextHolder.getContext() is null.

    This is not happening when I get it from the HTTP session.

Posting Permissions

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