@ FFDCIgnore ( AuthenticationException . class ) protected Subject recreateFullSubject ( WSPrincipal wsPrincipal , SecurityService securityService , AtomicServiceReference < UnauthenticatedSubjectService > unauthenticatedSubjectServiceRef , String customCacheKey ) { Subject subject = null ; if ( wsPrincipal != null ) { String userName = wsPrincipal . getName ( ) ; AuthenticateUserHelper authHelper = new AuthenticateUserHelper ( ) ; if ( jaasLoginContextEntry == null ) { jaasLoginContextEntry = DESERIALIZE_LOGINCONTEXT_DEFAULT ; } try { subject = authHelper . authenticateUser ( securityService . getAuthenticationService ( ) , userName , jaasLoginContextEntry , customCacheKey ) ; } catch ( AuthenticationException e ) { Tr . error ( tc , "SEC_CONTEXT_DESERIALIZE_AUTHN_ERROR" , new Object [ ] { e . getLocalizedMessage ( ) } ) ; } } if ( subject == null ) { subject = unauthenticatedSubjectServiceRef . getService ( ) . getUnauthenticatedSubject ( ) ; } return subject ; }
Perform a login to recreate the full subject given a WSPrincipal