Class AddAttributeStatementToAssertion
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.profile.impl.BaseAddAttributeStatementToAssertion<Attribute>
net.shibboleth.idp.saml.saml1.profile.impl.AddAttributeStatementToAssertion
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,ProfileAction
,Aware
,MessageSource
,MessageSourceAware
,Action
public class AddAttributeStatementToAssertion extends BaseAddAttributeStatementToAssertion<Attribute>
Action that builds an
AttributeStatement
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
The IdPAttribute
set to be encoded is drawn from an
AttributeContext
returned from a lookup strategy, by default located
on the RelyingPartyContext
beneath the profile request context.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
AddAttributeStatementToAssertion.AssertionStrategy
Default strategy for obtaining assertion to modify. -
Field Summary
Fields Modifier and Type Field Description private Function<ProfileRequestContext,Assertion>
assertionLookupStrategy
Strategy used to locate theAssertion
to operate on.private org.slf4j.Logger
log
Class logger. -
Constructor Summary
Constructors Constructor Description AddAttributeStatementToAssertion()
Constructor. -
Method Summary
Modifier and Type Method Description private AttributeStatement
buildAttributeStatement(ProfileRequestContext profileRequestContext, Collection<IdPAttribute> attributes)
Builds an attribute statement from a collection of attributes.protected void
doExecute(ProfileRequestContext profileRequestContext)
private void
encodeAttribute(AttributeTranscoderRegistry registry, ProfileRequestContext profileRequestContext, IdPAttribute attribute, Collection<Attribute> results)
EncodesIdPAttribute
into zero or moreAttribute
objects if a proper encoder is available.void
setAssertionLookupStrategy(Function<ProfileRequestContext,Assertion> strategy)
Set the strategy used to locate theAssertion
to operate on.Methods inherited from class net.shibboleth.idp.saml.profile.impl.BaseAddAttributeStatementToAssertion
doInitialize, doPreExecute, encodeAttribute, getAttributeContext, getIdGenerator, getIssuerId, getTranscoderRegistry, isIgnoringUnencodableAttributes, isStatementInOwnAssertion, setAttributeContextLookupStrategy, setIdentifierGeneratorLookupStrategy, setIgnoringUnencodableAttributes, setIssuerLookupStrategy, setStatementInOwnAssertion, setTranscoderRegistry
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getMessage, getMessage, getMessage, 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, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
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. -
assertionLookupStrategy
Strategy used to locate theAssertion
to operate on.
-
-
Constructor Details
-
AddAttributeStatementToAssertion
public AddAttributeStatementToAssertion()Constructor.
-
-
Method Details
-
setAssertionLookupStrategy
public void setAssertionLookupStrategy(@Nonnull Function<ProfileRequestContext,Assertion> strategy)Set the strategy used to locate theAssertion
to operate on.- Parameters:
strategy
- strategy used to locate theAssertion
to operate on
-
doExecute
- Overrides:
doExecute
in classAbstractProfileAction
-
buildAttributeStatement
@Nullable private AttributeStatement buildAttributeStatement(@Nonnull ProfileRequestContext profileRequestContext, @Nullable @NullableElements Collection<IdPAttribute> attributes) throws AttributeEncodingExceptionBuilds an attribute statement from a collection of attributes.- Parameters:
profileRequestContext
- current profile request contextattributes
- the collection of attributes- Returns:
- the attribute statement or null if no attributes can be encoded
- Throws:
AttributeEncodingException
- thrown if there is a problem encoding an attribute
-
encodeAttribute
private void encodeAttribute(@Nonnull AttributeTranscoderRegistry registry, @Nonnull ProfileRequestContext profileRequestContext, @Nonnull IdPAttribute attribute, @Nonnull @NonnullElements Collection<Attribute> results) throws AttributeEncodingExceptionEncodesIdPAttribute
into zero or moreAttribute
objects if a proper encoder is available.- Parameters:
registry
- transcoding registryprofileRequestContext
- current profile request contextattribute
- the attribute to be encodedresults
- collection to add the encoded SAML attributes to- Throws:
AttributeEncodingException
- thrown if there is a problem encoding an attribute
-