1 Reply Latest reply on Nov 28, 2011 8:11 AM by bysse

    Getting wrong CallerPrincipal from SessionContext

    bysse Newbie

      I'm having problems with a custom login module in JBoss 6.0.0 Final.

      What it's doing is authenticating the user with LDAP and then uses another username in the returned principal. (legacy support, why else?)

      So basically:

      1. Get LDAP credentials with the callbacks (username A)
      2. Authenticate against LDAP
      3. Create identity with username B
      4. Create roleset with Roles and CallerPrincipal
      5. Done


      So far everything works fine, but when i call SessionContext.getCallerPrincipal from an EJB i get a principal with username A.

      SecurityAssociation.getSubject() will return a subject the correct Principals ie username B.


      Does anyone have any idea of why this is happening?