Class AddAuthnStatementToAssertionFromInboundAssertionToken
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.saml.saml2.profile.delegation.impl.AddAuthnStatementToAssertionFromInboundAssertionToken
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,ProfileAction
,Aware
,MessageSource
,MessageSourceAware
,Action
@Prototype
public class AddAuthnStatementToAssertionFromInboundAssertionToken
extends AbstractProfileAction
Action that builds an
AuthnStatement
and adds it to an Assertion
returned by a lookup
strategy, by default in the InOutOperationContext.getOutboundMessageContext()
.
This action is designed specifically to be used with SAML 2 delegation.
The AuthnStatement
will be cloned directly from the inbound Assertion
token obtained
from via the setAssertionTokenStrategy(Function)
.
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(ProfileRequestContext)
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Default strategy for obtaining assertion to modify. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,
Assertion> Strategy used to locate theAssertion
to operate on.private Function<ProfileRequestContext,
Assertion> Function used to resolve the inbound assertion token to process.private IdentifierGenerationStrategy
The generator to use.Strategy used to locate theIdentifierGenerationStrategy
to use.private String
EntityID to populate as assertion issuer.private Function<ProfileRequestContext,
String> Strategy used to obtain the assertion issuer value.private final org.slf4j.Logger
Class logger.private AuthnStatement
The authentication statement which is to be cloned into the new Assertion.private boolean
Whether the generated authentication statement should be placed in its own assertion or added to one if it exists. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doExecute
(ProfileRequestContext profileRequestContext) protected void
protected boolean
doPreExecute
(ProfileRequestContext profileRequestContext) Get theIdentifierGenerationStrategy
to use if an assertion must be created.Get the issuer name to use if an assertion must be created.protected AuthnStatement
Obtain the newAuthnStatement
to add by cloning the inbound token's statement which was previously stored.boolean
Set whether the generated statement should be placed in its own assertion or added to one if it exists.void
Set the strategy used to locate theAssertion
to operate on.void
Set the strategy used to locate the inbound assertion token to process.void
setIdentifierGeneratorLookupStrategy
(Function<ProfileRequestContext, IdentifierGenerationStrategy> strategy) Set the strategy used to locate theIdentifierGenerationStrategy
to use.void
Set the strategy used to locate the issuer value to use.void
setStatementInOwnAssertion
(boolean inOwnAssertion) Set whether the generated authentication statement should be placed in its own assertion or added to one if it exists.Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy
Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationCondition
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplier
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
statementInOwnAssertion
private boolean statementInOwnAssertionWhether the generated authentication statement should be placed in its own assertion or added to one if it exists. -
idGeneratorLookupStrategy
@Nonnull private Function<ProfileRequestContext,IdentifierGenerationStrategy> idGeneratorLookupStrategyStrategy used to locate theIdentifierGenerationStrategy
to use. -
issuerLookupStrategy
Strategy used to obtain the assertion issuer value. -
idGenerator
The generator to use. -
issuerId
EntityID to populate as assertion issuer. -
assertionLookupStrategy
Strategy used to locate theAssertion
to operate on. -
assertionTokenStrategy
Function used to resolve the inbound assertion token to process. -
sourceStatement
The authentication statement which is to be cloned into the new Assertion.
-
-
Constructor Details
-
AddAuthnStatementToAssertionFromInboundAssertionToken
public AddAuthnStatementToAssertionFromInboundAssertionToken()Constructor.
-
-
Method Details
-
isStatementInOwnAssertion
public boolean isStatementInOwnAssertion()Set whether the generated statement should be placed in its own assertion or added to one if it exists.- Returns:
- whether the generated statement should be placed in its own assertion or added to one if it exists
-
setStatementInOwnAssertion
public void setStatementInOwnAssertion(boolean inOwnAssertion) Set whether the generated authentication statement should be placed in its own assertion or added to one if it exists.- Parameters:
inOwnAssertion
- whether the generated authentication statement should be placed in its own assertion or added to one if it exists
-
setAssertionTokenStrategy
Set the strategy used to locate the inbound assertion token to process.- Parameters:
strategy
- lookup strategy
-
setIdentifierGeneratorLookupStrategy
public void setIdentifierGeneratorLookupStrategy(@Nonnull Function<ProfileRequestContext, IdentifierGenerationStrategy> strategy) Set the strategy used to locate theIdentifierGenerationStrategy
to use.- Parameters:
strategy
- lookup strategy
-
setIssuerLookupStrategy
Set the strategy used to locate the issuer value to use.- Parameters:
strategy
- lookup strategy
-
getIdGenerator
Get theIdentifierGenerationStrategy
to use if an assertion must be created.- Returns:
- the ID generation strategy
-
getIssuerId
Get the issuer name to use if an assertion must be created.- Returns:
- the issuer name
-
setAssertionLookupStrategy
Set the strategy used to locate theAssertion
to operate on.- Parameters:
strategy
- strategy used to locate theAssertion
to operate on
-
doInitialize
- Overrides:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecute
in classAbstractConditionalProfileAction
-
doExecute
- Overrides:
doExecute
in classAbstractProfileAction
-
getNewAuthnStatement
Obtain the newAuthnStatement
to add by cloning the inbound token's statement which was previously stored.- Returns:
- the cloned AuthnStatement, or null if an error is encountered
-