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.
| Modifier and Type | Class and Description |
|---|---|
private class |
AddAuthnStatementToAssertion.AssertionStrategy
Default strategy for obtaining assertion to modify.
|
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.base.Function<ProfileRequestContext,Assertion> |
assertionLookupStrategy
Strategy used to locate the
Assertion to operate on. |
private com.google.common.base.Function<ProfileRequestContext,AuthnContextClassRefPrincipal> |
classRefLookupStrategy
Strategy used to determine the AuthnContextClassRef.
|
private org.slf4j.Logger |
log
Class logger.
|
private com.google.common.base.Function<ProfileRequestContext,Long> |
sessionLifetimeLookupStrategy
Strategy used to determine SessionNotOnOrAfter value to set.
|
| Constructor and Description |
|---|
AddAuthnStatementToAssertion()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private AuthnStatement |
buildAuthnStatement(ProfileRequestContext profileRequestContext,
RequestedPrincipalContext requestedPrincipalContext)
Build the
AuthnStatement to be added to the Response. |
protected void |
doExecute(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext) |
protected void |
doInitialize() |
void |
setAssertionLookupStrategy(com.google.common.base.Function<ProfileRequestContext,Assertion> strategy)
Set the strategy used to locate the
Assertion to operate on. |
void |
setClassRefLookupStrategy(com.google.common.base.Function<ProfileRequestContext,AuthnContextClassRefPrincipal> strategy)
Set the strategy function to use to obtain the authentication context class reference to use.
|
void |
setSessionLifetimeLookupStrategy(com.google.common.base.Function<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 com.google.common.base.Function<ProfileRequestContext,Assertion> assertionLookupStrategy
Assertion to operate on.@NonnullAfterInit private com.google.common.base.Function<ProfileRequestContext,AuthnContextClassRefPrincipal> classRefLookupStrategy
@Nullable private com.google.common.base.Function<ProfileRequestContext,Long> sessionLifetimeLookupStrategy
public void setAssertionLookupStrategy(@Nonnull com.google.common.base.Function<ProfileRequestContext,Assertion> strategy)
Assertion to operate on.strategy - strategy used to locate the Assertion to operate onpublic void setClassRefLookupStrategy(@Nonnull com.google.common.base.Function<ProfileRequestContext,AuthnContextClassRefPrincipal> strategy)
strategy - authentication context class reference lookup strategypublic void setSessionLifetimeLookupStrategy(@Nullable com.google.common.base.Function<ProfileRequestContext,Long> strategy)
strategy - lookup strategyprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationExceptionprotected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
doExecute in class AbstractAuthenticationAction@Nonnull private AuthnStatement buildAuthnStatement(@Nonnull ProfileRequestContext profileRequestContext, @Nullable RequestedPrincipalContext requestedPrincipalContext)
AuthnStatement to be added to the Response.profileRequestContext - current request contextrequestedPrincipalContext - context specifying request requirements for authn contextCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.