private AuthenticationResult handleJwtSSO ( HttpServletRequest req , HttpServletResponse res ) { String jwtCookieName = JwtSSOTokenHelper . getJwtCookieName ( ) ; if ( jwtCookieName == null ) { // jwtsso feature not active return null ; } String encodedjwtssotoken = ssoCookieHelper . getJwtSsoTokenFromCookies ( req , jwtCookieName ) ; if ( encodedjwtssotoken == null ) { //jwt sso cookie is missing, look at the auth header encodedjwtssotoken = getJwtBearerToken ( req ) ; } if ( encodedjwtssotoken == null ) { return null ; } else { if ( LoggedOutJwtSsoCookieCache . contains ( encodedjwtssotoken ) ) { String LoggedOutMsg = "JWT_ALREADY_LOGGED_OUT" ; if ( req . getAttribute ( LoggedOutMsg ) == null ) { Tr . audit ( tc , LoggedOutMsg , new Object [ ] { } ) ; req . setAttribute ( LoggedOutMsg , "true" ) ; } return new AuthenticationResult ( AuthResult . FAILURE , Tr . formatMessage ( tc , LoggedOutMsg ) ) ; } return authenticateWithJwt ( req , res , encodedjwtssotoken ) ; } }
If there is no jwtSSOToken we will return null . Otherwise we will AuthenticationResult .