Class ProcessAssertionsForAuthentication
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.saml.saml2.profile.impl.ProcessAssertionsForAuthentication
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
Perform processing of a SAML 2 Response's Assertions that have been validated by earlier actions
for use in finalization of SAML-based authentication by later actions.
The result of this action is to strip any invalid assertions from the response, and to preserve
the "best"/selected AuthnStatement and any other content required in a pluggable manner.
The default behavior is to store the statement and the related Subject in a SAMLAuthnContext
located by a lookup strategy.
- Event:
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_MESSAGE,AuthnEventIds.INVALID_CREDENTIALS- Postcondition:
- the selected statement is passed into the supplied
BiConsumer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classPredicate for assertions containing at least 1 AuthenticationStatement.private final classPredicate for assertions which have been validated and have a confirmed Subject.private final classPredicate for valid assertions.private final classThe default response resolver function.private final classDefault implementation of a "sink" for the SAML objects preserved by this action. -
Field Summary
FieldsModifier and TypeFieldDescriptionSelection strategy for multiple valid authn Assertions.private Function<Assertion,AuthnStatement> Selection strategy for multiple AuthnStatements.private final org.slf4j.LoggerLogger.private ResponseThe Response to process.private Function<ProfileRequestContext,Response> The resolver for the response to be processed."Sink" for preserving SAML objects.Lookup strategy to locate the SAML context. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext) protected booleandoPreExecute(ProfileRequestContext profileRequestContext) voidsetAuthnAssertionSelectionStrategy(Function<List<Assertion>, Assertion> strategy) Set the strategy function for selecting which of multiple valid Assertions to use.voidSet the strategy function for selecting which of multiple AuthnStatements to use.voidsetResponseResolver(Function<ProfileRequestContext, Response> strategy) Set the strategy function which resolves the response to process.voidSet the lookup strategy used to locate theSAMLAuthnContext.voidSet theBiConsumerused to save off the SAML statemen and any related objects as a result of this action.Methods 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, doInitialize, 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 logLogger. -
responseResolver
The resolver for the response to be processed. -
samlContextLookupStrategy
Lookup strategy to locate the SAML context. -
samlConsumer
"Sink" for preserving SAML objects. -
authnAssertionSelectionStrategy
Selection strategy for multiple valid authn Assertions. -
authnStatementSelectionStrategy
Selection strategy for multiple AuthnStatements. -
response
The Response to process.
-
-
Constructor Details
-
ProcessAssertionsForAuthentication
public ProcessAssertionsForAuthentication()Constructor.
-
-
Method Details
-
setAuthnAssertionSelectionStrategy
public void setAuthnAssertionSelectionStrategy(@Nonnull Function<List<Assertion>, Assertion> strategy) Set the strategy function for selecting which of multiple valid Assertions to use.- Parameters:
strategy- the new strategy function
-
setAuthnStatementSelectionStrategy
public void setAuthnStatementSelectionStrategy(@Nonnull Function<Assertion, AuthnStatement> strategy) Set the strategy function for selecting which of multiple AuthnStatements to use.- Parameters:
strategy- the new strategy function
-
setResponseResolver
Set the strategy function which resolves the response to process.- Parameters:
strategy- the new strategy function
-
setSAMLAuthnContextLookupStrategy
public void setSAMLAuthnContextLookupStrategy(@Nonnull Function<ProfileRequestContext, SAMLAuthnContext> strategy) Set the lookup strategy used to locate theSAMLAuthnContext.- Parameters:
strategy- the new strategy function
-
setSAMLConsumer
Set theBiConsumerused to save off the SAML statemen and any related objects as a result of this action.This insulates the actiion from the specific context in which it may be used. The supplied consumer MUST establish any non-successful event via the supplied context if it fails.
- Parameters:
consumer- consumer to set
-
doPreExecute
- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-