private void setUnauthenticatedSubjectIfNeeded ( ) { if ( LocationUtils . isServer ( ) ) { com . ibm . ws . security . context . SubjectManager sm = new com . ibm . ws . security . context . SubjectManager ( ) ; Subject invokedSubject = sm . getInvocationSubject ( ) ; if ( invokedSubject == null ) { Subject callerSubject = sm . getCallerSubject ( ) ; if ( callerSubject == null ) { // create the unauthenticated subject and set as the invocation subject UnauthenticatedSubjectService unAuthenticationService = SecurityServices . getUnauthenticatedSubjectService ( ) ; if ( unAuthenticationService != null ) { sm . setInvocationSubject ( unAuthenticationService . getUnauthenticatedSubject ( ) ) ; } } } } }
Create un - authenticate subject if both caller and invoke subjects are null for client . We do not want to do this for client container .