Class AddSubjectConfirmationToSubjects
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.profile.action.AbstractProfileAction
-
- org.opensaml.saml.saml1.profile.impl.AddSubjectConfirmationToSubjects
-
- All Implemented Interfaces:
net.shibboleth.utilities.java.support.component.Component,net.shibboleth.utilities.java.support.component.DestructableComponent,net.shibboleth.utilities.java.support.component.InitializableComponent,org.opensaml.profile.action.ProfileAction
public class AddSubjectConfirmationToSubjects extends org.opensaml.profile.action.AbstractProfileActionAction that buildsSubjectConfirmationand adds it to theSubjectof all the statements in all the assertions found in aResponse. The message to update is returned by a lookup strategy, by default the message returned byInOutOperationContext.getOutboundMessageContext().No assertions or statements will be created by this action, but if no
Subjectexists in the statements found, it will be created.- Event:
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_MSG_CTX
-
-
Field Summary
Fields Modifier and Type Field Description private booleanartifactProfileFlag indicating whether the outbound message is being issued via the Artifact profile.private org.opensaml.saml.common.SAMLObjectBuilder<org.opensaml.saml.saml1.core.SubjectConfirmation>confirmationBuilderBuilder for SubjectConfirmation objects.private org.opensaml.saml.common.SAMLObjectBuilder<org.opensaml.saml.saml1.core.ConfirmationMethod>confirmationMethodBuilderBuilder for ConfirmationMethod objects.private Collection<String>confirmationMethodsMethods to add.private LoggerlogClass logger.private booleanoverwriteExistingFlag controlling whether to overwrite an existing confirmation.private org.opensaml.saml.saml1.core.ResponseresponseResponse to modify.private Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml1.core.Response>responseLookupStrategyStrategy used to locate theResponseto operate on.private org.opensaml.saml.common.SAMLObjectBuilder<org.opensaml.saml.saml1.core.Subject>subjectBuilderBuilder for Subject objects.
-
Constructor Summary
Constructors Constructor Description AddSubjectConfirmationToSubjects()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.opensaml.saml.saml1.core.SubjectConfirmationcloneConfirmation(org.opensaml.saml.saml1.core.SubjectConfirmation confirmation)Create an efficient field-wise copy of aSubjectConfirmation.protected voiddoExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)protected voiddoInitialize()protected booleandoPreExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)private org.opensaml.saml.saml1.core.SubjectgetStatementSubject(org.opensaml.saml.saml1.core.SubjectStatement statement)Get the subject to which the confirmation will be added.voidsetMethods(Collection<String> methods)Set the confirmation methods to use.voidsetOverwriteExisting(boolean flag)Set whether to overwrite any existingSubjectConfirmationobjects found.voidsetResponseLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml1.core.Response> strategy)Set the strategy used to locate theResponseto operate on.-
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private final Logger log
Class logger.
-
subjectBuilder
@Nonnull private final org.opensaml.saml.common.SAMLObjectBuilder<org.opensaml.saml.saml1.core.Subject> subjectBuilder
Builder for Subject objects.
-
confirmationBuilder
@Nonnull private final org.opensaml.saml.common.SAMLObjectBuilder<org.opensaml.saml.saml1.core.SubjectConfirmation> confirmationBuilder
Builder for SubjectConfirmation objects.
-
confirmationMethodBuilder
@Nonnull private final org.opensaml.saml.common.SAMLObjectBuilder<org.opensaml.saml.saml1.core.ConfirmationMethod> confirmationMethodBuilder
Builder for ConfirmationMethod objects.
-
overwriteExisting
private boolean overwriteExisting
Flag controlling whether to overwrite an existing confirmation.
-
responseLookupStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml1.core.Response> responseLookupStrategy
Strategy used to locate theResponseto operate on.
-
confirmationMethods
@Nonnull @NonnullElements private Collection<String> confirmationMethods
Methods to add.
-
response
@Nullable private org.opensaml.saml.saml1.core.Response response
Response to modify.
-
artifactProfile
private boolean artifactProfile
Flag indicating whether the outbound message is being issued via the Artifact profile.
-
-
Method Detail
-
setOverwriteExisting
public void setOverwriteExisting(boolean flag)
Set whether to overwrite any existingSubjectConfirmationobjects found.- Parameters:
flag- true iff the action should overwrite any existing objects
-
setResponseLookupStrategy
public void setResponseLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml1.core.Response> strategy)Set the strategy used to locate theResponseto operate on.- Parameters:
strategy- strategy used to locate theResponseto operate on
-
setMethods
public void setMethods(@Nonnull @NonnullElements Collection<String> methods)Set the confirmation methods to use.- Parameters:
methods- confirmation methods to use
-
doInitialize
protected void doInitialize() throws net.shibboleth.utilities.java.support.component.ComponentInitializationException- Overrides:
doInitializein classnet.shibboleth.utilities.java.support.component.AbstractInitializableComponent- Throws:
net.shibboleth.utilities.java.support.component.ComponentInitializationException
-
doPreExecute
protected boolean doPreExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classorg.opensaml.profile.action.AbstractProfileAction
-
doExecute
protected void doExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classorg.opensaml.profile.action.AbstractProfileAction
-
getStatementSubject
@Nonnull private org.opensaml.saml.saml1.core.Subject getStatementSubject(@Nonnull org.opensaml.saml.saml1.core.SubjectStatement statement)Get the subject to which the confirmation will be added.- Parameters:
statement- the statement being modified- Returns:
- the subject to which the confirmation will be added
-
cloneConfirmation
@Nonnull private org.opensaml.saml.saml1.core.SubjectConfirmation cloneConfirmation(@Nonnull org.opensaml.saml.saml1.core.SubjectConfirmation confirmation)Create an efficient field-wise copy of aSubjectConfirmation.- Parameters:
confirmation- the object to clone- Returns:
- the copy
-
-