public class AddAuthnStatementToAssertion extends BaseAddAuthenticationStatementToAssertion
AuthnStatement and adds it to an Assertion returned by a lookup
strategy, by default in the InOutOperationContext.getOutboundMessageContext().
If no Response exists, then an Assertion directly in the outbound message context will
be used or created
A constructed Assertion will have its ID, IssueInstant, Issuer, and Version properties set.
The issuer is based on RelyingPartyConfiguration.getResponderId().
The AuthnStatement will have its authentication instant set, based on
AuthenticationResult.getAuthenticationInstant()
via AuthenticationContext.getAuthenticationResult().
The AuthnContext will be set via RequestedPrincipalContext.getMatchingPrincipal(), or via an injected
or defaulted function that obtains a custom principal from the profile context.
The SessionIndex and optionally SessionNotOnOrAfter attributes will also be set.
EventIds.PROCEED_EVENT_ID, EventIds.INVALID_MSG_CTX, EventIds.INVALID_PROFILE_CTX, AuthnEventIds.INVALID_AUTHN_CTX| Modifier and Type | Class and Description |
|---|---|
private class |
AddAuthnStatementToAssertion.AssertionStrategy
Default strategy for obtaining assertion to modify.
|
| Modifier and Type | Field and Description |
|---|---|
private Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Assertion> |
assertionLookupStrategy
Strategy used to locate the
Assertion to operate on. |
private Function<org.opensaml.profile.context.ProfileRequestContext,AuthnContextClassRefPrincipal> |
classRefLookupStrategy
Strategy used to determine the AuthnContextClassRef.
|
private org.slf4j.Logger |
log
Class logger.
|
private Function<org.opensaml.profile.context.ProfileRequestContext,Long> |
sessionLifetimeLookupStrategy
Strategy used to determine SessionNotOnOrAfter value to set.
|
| Constructor and Description |
|---|
AddAuthnStatementToAssertion()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private org.opensaml.saml.saml2.core.AuthnStatement |
buildAuthnStatement(org.opensaml.profile.context.ProfileRequestContext profileRequestContext,
RequestedPrincipalContext requestedPrincipalContext)
Build the
AuthnStatement to be added to the Response. |
protected void |
doExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext) |
protected void |
doInitialize() |
void |
setAssertionLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Assertion> strategy)
Set the strategy used to locate the
Assertion to operate on. |
void |
setClassRefLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,AuthnContextClassRefPrincipal> strategy)
Set the strategy function to use to obtain the authentication context class reference to use.
|
void |
setSessionLifetimeLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,Long> strategy)
Set the strategy used to locate the SessionNotOnOrAfter value to use.
|
doPreExecute, getAuthenticationResult, getIdGenerator, getIssuerId, isStatementInOwnAssertion, setIdentifierGeneratorLookupStrategy, setIssuerLookupStrategy, setStatementInOwnAssertiondoExecute, doPreExecute, setLookupStrategydoExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategygetActivationCondition, setActivationConditiondoPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, isInitialized@Nonnull private final org.slf4j.Logger log
@NonnullAfterInit private Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Assertion> assertionLookupStrategy
Assertion to operate on.@NonnullAfterInit private Function<org.opensaml.profile.context.ProfileRequestContext,AuthnContextClassRefPrincipal> classRefLookupStrategy
public void setAssertionLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Assertion> strategy)
Assertion to operate on.strategy - strategy used to locate the Assertion to operate onpublic void setClassRefLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,AuthnContextClassRefPrincipal> strategy)
strategy - authentication context class reference lookup strategypublic void setSessionLifetimeLookupStrategy(@Nullable Function<org.opensaml.profile.context.ProfileRequestContext,Long> strategy)
strategy - lookup strategyprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationExceptionprotected void doExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
doExecute in class AbstractAuthenticationAction@Nonnull private org.opensaml.saml.saml2.core.AuthnStatement buildAuthnStatement(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext, @Nullable RequestedPrincipalContext requestedPrincipalContext)
AuthnStatement to be added to the Response.profileRequestContext - current request contextrequestedPrincipalContext - context specifying request requirements for authn contextCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.