Class AddAuthenticationStatementToAssertion
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.authn.AbstractAuthenticationAction
net.shibboleth.idp.saml.profile.impl.BaseAddAuthenticationStatementToAssertion
net.shibboleth.idp.saml.saml1.profile.impl.AddAuthenticationStatementToAssertion
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class AddAuthenticationStatementToAssertion
extends BaseAddAuthenticationStatementToAssertion
Action that builds an
AuthenticationStatement 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.getIssuer(ProfileRequestContext).
The AuthenticationStatement will have its authentication instant set, based on
AuthenticationResult.getAuthenticationInstant()
via AuthenticationContext.getAuthenticationResult().
The method property will be set via RequestedPrincipalContext.getMatchingPrincipal(), or via an injected
or defaulted function that obtains an AuthenticationMethodPrincipal from the profile context.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classDefault strategy for obtaining assertion to modify. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,Assertion> Strategy used to locate theAssertionto operate on.private final org.slf4j.LoggerClass logger.Strategy used to determine the AuthenticationMethod attribute. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate AuthenticationStatementbuildAuthenticationStatement(ProfileRequestContext profileRequestContext, RequestedPrincipalContext requestedPrincipalContext) Build theAuthenticationStatementto be added to theResponse.protected voiddoExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) Performs this authentication action.protected voidvoidSet the strategy used to locate theAssertionto operate on.voidsetAuthenticationMethodLookupStrategy(Function<ProfileRequestContext, AuthenticationMethodPrincipal> strategy) Set the strategy function to use to obtain the authentication method to use.Methods inherited from class net.shibboleth.idp.saml.profile.impl.BaseAddAuthenticationStatementToAssertion
doPreExecute, getAddressLookupStrategy, getAuthenticationResult, getIdGenerator, getIssuerId, isStatementInOwnAssertion, setAddressLookupStrategy, setIdentifierGeneratorLookupStrategy, setIssuerLookupStrategy, setStatementInOwnAssertionMethods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction
doExecute, doPreExecute, setAuthenticationContextLookupStrategyMethods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
assertionLookupStrategy
Strategy used to locate theAssertionto operate on. -
methodLookupStrategy
@NonnullAfterInit private Function<ProfileRequestContext,AuthenticationMethodPrincipal> methodLookupStrategyStrategy used to determine the AuthenticationMethod attribute.
-
-
Constructor Details
-
AddAuthenticationStatementToAssertion
public AddAuthenticationStatementToAssertion()
-
-
Method Details
-
setAssertionLookupStrategy
Set the strategy used to locate theAssertionto operate on.- Parameters:
strategy- strategy used to locate theAssertionto operate on
-
setAuthenticationMethodLookupStrategy
public void setAuthenticationMethodLookupStrategy(@Nonnull Function<ProfileRequestContext, AuthenticationMethodPrincipal> strategy) Set the strategy function to use to obtain the authentication method to use.- Parameters:
strategy- authentication method lookup strategy
-
doInitialize
- Overrides:
doInitializein classBaseAddAuthenticationStatementToAssertion- Throws:
ComponentInitializationException
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) Performs this authentication action. Default implementation throws an exception.- Overrides:
doExecutein classAbstractAuthenticationAction- Parameters:
profileRequestContext- the current IdP profile request contextauthenticationContext- the current authentication context
-
buildAuthenticationStatement
@Nonnull private AuthenticationStatement buildAuthenticationStatement(@Nonnull ProfileRequestContext profileRequestContext, @Nullable RequestedPrincipalContext requestedPrincipalContext) Build theAuthenticationStatementto be added to theResponse.- Parameters:
profileRequestContext- current request contextrequestedPrincipalContext- context specifying request requirements for authn method- Returns:
- the authentication statement
-