public static Cookie getSSOCookieFromSSOToken ( ) throws Exception { Subject subject = null ; Cookie ltpaCookie = null ; if ( webAppSecConfig == null ) { // if we don't have the config, we can't construct the cookie return null ; } try { subject = WSSubject . getRunAsSubject ( ) ; if ( subject == null ) { subject = WSSubject . getCallerSubject ( ) ; } if ( subject != null ) { ltpaCookie = getLTPACookie ( subject ) ; } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No subjects on the thread" ) ; } } } catch ( Exception e ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getSSOCookieFromSSOToken caught exception: " + e . getMessage ( ) ) ; } throw e ; } return ltpaCookie ; }
Extracts an LTPA sso cookie from the subject of current thread and builds a ltpa cookie out of it for use on downstream web invocations . The caller must check for null return value only when not null that getName and getValue can be invoked on the returned Cookie object