Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-6004

JAASCallbackHandler resets SecurityContext after authentication to it's pre-authentication value

XMLWordPrintable

    • Hide

      Configure ApplicationRealm to use JAAS authentication.
      For the referenced security domain include the ClientLoginModule (last)
      Perform a remote EJB method - not that the SecurityContext as set in ClientLoginModule is blown away in SimpleSecurityManager.pop() (called by JaasCallbackHandler )

      Show
      Configure ApplicationRealm to use JAAS authentication. For the referenced security domain include the ClientLoginModule (last) Perform a remote EJB method - not that the SecurityContext as set in ClientLoginModule is blown away in SimpleSecurityManager.pop() (called by JaasCallbackHandler )
    • Compatibility/Configuration

      We are using remote EJB calls and are finding role information being lost.

      I have traced this to our use of JAAS authentication for the ApplicationRealm security realm

      Within the handle() method of JaasCallbackHander it stores the current Security context at that point (via securityManager.push())

      It then calls securityManager.authenticate() which results in login modules being called. We use the ClientLoginModule which stores information on the SecurityContext via SecurityAssociationActions.setPrincipalInfo

      After authentication the JaasCallbackHandler calls securityManager.pop() which resets the SecurityContext back its state before authentication - thus losing the context set in the ClientLoginModule.

      This only occurs via a remote ejb call, not via a call made from the web tier (as it does not use JaasLoginHandler)

      Ideally I'd like some way to stop the JaasCallbackHandler reseting the SecurityContext (even if it was incredibly simple by checking for an attribute on the current security context)

      The same operations work in EAP 6.3 / JBoss 7.2

              darran.lofthouse@redhat.com Darran Lofthouse
              ianmacintyre Ian MacIntyre (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: