@ Override @ FFDCIgnore ( Exception . class ) public Subject getUnauthenticatedSubject ( ) { if ( unauthenticatedSubject == null ) { CredentialsService cs = credentialsServiceRef . getService ( ) ; String unauthenticatedUserid = cs . getUnauthenticatedUserid ( ) ; try { Subject subject = new Subject ( ) ; Hashtable < String , Object > hashtable = new Hashtable < String , Object > ( ) ; hashtable . put ( AttributeNameConstants . WSCREDENTIAL_SECURITYNAME , unauthenticatedUserid ) ; hashtable . put ( AttributeNameConstants . WSCREDENTIAL_UNIQUEID , AccessIdUtil . createAccessId ( AccessIdUtil . TYPE_USER , getUserRegistryRealm ( ) , unauthenticatedUserid ) ) ; subject . getPublicCredentials ( ) . add ( hashtable ) ; SecurityService securityService = securityServiceRef . getService ( ) ; AuthenticationService authenticationService = securityService . getAuthenticationService ( ) ; Subject tempUnauthenticatedSubject = authenticationService . authenticate ( JaasLoginConfigConstants . SYSTEM_UNAUTHENTICATED , subject ) ; tempUnauthenticatedSubject . setReadOnly ( ) ; synchronized ( unauthenticatedSubjectLock ) { if ( unauthenticatedSubject == null ) { unauthenticatedSubject = tempUnauthenticatedSubject ; } } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Internal error creating UNAUTHENTICATED subject." , e ) ; } } } return unauthenticatedSubject ; }
Return the unauthenticated subject . If we don t already have one create it .