@Prototype public class AddAuthnStatementToAssertionFromInboundAssertionToken extends AbstractProfileAction
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().
EventIds.INVALID_MSG_CTX, EventIds.INVALID_PROFILE_CTX, EventIds.MESSAGE_PROC_ERROR| Modifier and Type | Class and Description |
|---|---|
private class |
AddAuthnStatementToAssertionFromInboundAssertionToken.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,org.opensaml.saml.saml2.core.Assertion> |
assertionTokenStrategy
Function used to resolve the inbound assertion token to process.
|
private IdentifierGenerationStrategy |
idGenerator
The generator to use.
|
private Function<org.opensaml.profile.context.ProfileRequestContext,IdentifierGenerationStrategy> |
idGeneratorLookupStrategy
Strategy used to locate the
IdentifierGenerationStrategy to use. |
private String |
issuerId
EntityID to populate as assertion issuer.
|
private Function<org.opensaml.profile.context.ProfileRequestContext,String> |
issuerLookupStrategy
Strategy used to obtain the assertion issuer value.
|
private org.slf4j.Logger |
log
Class logger.
|
private org.opensaml.saml.saml2.core.AuthnStatement |
sourceStatement
The authentication statement which is to be cloned into the new Assertion.
|
private boolean |
statementInOwnAssertion
Whether the generated authentication statement should be placed in its own assertion or added to one if it
exists.
|
| Constructor and Description |
|---|
AddAuthnStatementToAssertionFromInboundAssertionToken()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) |
protected void |
doInitialize() |
protected boolean |
doPreExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) |
IdentifierGenerationStrategy |
getIdGenerator()
Get the
IdentifierGenerationStrategy to use if an assertion must be created. |
String |
getIssuerId()
Get the issuer name to use if an assertion must be created.
|
protected org.opensaml.saml.saml2.core.AuthnStatement |
getNewAuthnStatement()
Obtain the new
AuthnStatement to add by cloning the inbound token's statement
which was previously stored. |
boolean |
isStatementInOwnAssertion()
Set whether the generated statement should be placed in its own assertion or added to one if it exists.
|
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 |
setAssertionTokenStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Assertion> strategy)
Set the strategy used to locate the inbound assertion token to process.
|
void |
setIdentifierGeneratorLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,IdentifierGenerationStrategy> strategy)
Set the strategy used to locate the
IdentifierGenerationStrategy to use. |
void |
setIssuerLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,String> strategy)
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.
|
doExecute, 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
private boolean statementInOwnAssertion
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,IdentifierGenerationStrategy> idGeneratorLookupStrategy
IdentifierGenerationStrategy to use.@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,String> issuerLookupStrategy
@Nullable private IdentifierGenerationStrategy idGenerator
@NonnullAfterInit private Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Assertion> assertionLookupStrategy
Assertion to operate on.@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Assertion> assertionTokenStrategy
@Nullable private org.opensaml.saml.saml2.core.AuthnStatement sourceStatement
public AddAuthnStatementToAssertionFromInboundAssertionToken()
public boolean isStatementInOwnAssertion()
public void setStatementInOwnAssertion(boolean inOwnAssertion)
inOwnAssertion - whether the generated authentication statement should be placed in its own assertion or
added to one if it existspublic void setAssertionTokenStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Assertion> strategy)
strategy - lookup strategypublic void setIdentifierGeneratorLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,IdentifierGenerationStrategy> strategy)
IdentifierGenerationStrategy to use.strategy - lookup strategypublic void setIssuerLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,String> strategy)
strategy - lookup strategy@Nonnull public IdentifierGenerationStrategy getIdGenerator()
IdentifierGenerationStrategy to use if an assertion must be created.@Nonnull public String getIssuerId()
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 onprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationExceptionprotected boolean doPreExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
doPreExecute in class org.opensaml.profile.action.AbstractConditionalProfileActionprotected void doExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
doExecute in class org.opensaml.profile.action.AbstractProfileAction@Nullable protected org.opensaml.saml.saml2.core.AuthnStatement getNewAuthnStatement()
AuthnStatement to add by cloning the inbound token's statement
which was previously stored.Copyright © 1999–2017 Shibboleth Consortium. All rights reserved.