protected void setAuthenticatingAuthority ( Assertion assertion , Assertion proxiedAssertion ) { if ( proxiedAssertion . getIssuer ( ) == null || proxiedAssertion . getIssuer ( ) . getValue ( ) == null ) { log . warn ( "No issuer element found in proxied assertion" ) ; return ; } if ( assertion . getAuthnStatements ( ) . isEmpty ( ) ) { log . warn ( "No AuthnStatement available is assertion to update - will not process" ) ; return ; } AuthnStatement authnStatement = assertion . getAuthnStatements ( ) . get ( 0 ) ; if ( authnStatement . getAuthnContext ( ) == null ) { log . warn ( "No AuthnContext found in assertion to update - will not process" ) ; } final XMLObjectBuilderFactory bf = XMLObjectProviderRegistrySupport . getBuilderFactory ( ) ; SAMLObjectBuilder < AuthenticatingAuthority > aaBuilder = ( SAMLObjectBuilder < AuthenticatingAuthority > ) bf . < AuthenticatingAuthority > getBuilderOrThrow ( AuthenticatingAuthority . DEFAULT_ELEMENT_NAME ) ; AuthenticatingAuthority aa = aaBuilder . buildObject ( ) ; aa . setURI ( proxiedAssertion . getIssuer ( ) . getValue ( ) ) ; authnStatement . getAuthnContext ( ) . getAuthenticatingAuthorities ( ) . add ( aa ) ; log . info ( "Updated Assertion with AuthenticatingAuthority ({})" , aa . getURI ( ) ) ; }
Assigns the AuthenticatingAuthority element holding the issuer of the proxied assertion .