Class AddAttributeStatementToAssertion
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.profile.impl.BaseAddAttributeStatementToAssertion<Attribute>
net.shibboleth.idp.saml.saml2.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 ClassesModifier and TypeClassDescriptionprivate classDefault strategy for obtaining assertion to modify. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,Assertion> Strategy used to locate theAssertionto operate on.private final org.slf4j.LoggerClass logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate AttributeStatementbuildAttributeStatement(ProfileRequestContext profileRequestContext, Collection<IdPAttribute> attributes) Builds an attribute statement from a collection of attributes.protected voiddoExecute(ProfileRequestContext profileRequestContext) private voidencodeAttribute(AttributeTranscoderRegistry registry, ProfileRequestContext profileRequestContext, IdPAttribute attribute, Collection<Attribute> results) Encodes aIdPAttributeinto zero or moreAttributeobjects if a proper encoder is available.private AttributefindExistingAttribute(AttributeStatement statement, Attribute newAttribute) Find a matchingAttributein the statement, if any.voidSet the strategy used to locate theAssertionto 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, setTranscoderRegistryMethods 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, 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 logClass logger. -
assertionLookupStrategy
Strategy used to locate theAssertionto operate on.
-
-
Constructor Details
-
AddAttributeStatementToAssertion
public AddAttributeStatementToAssertion()Constructor.
-
-
Method Details
-
setAssertionLookupStrategy
Set the strategy used to locate theAssertionto operate on.- Parameters:
strategy- strategy used to locate theAssertionto operate on
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
buildAttributeStatement
@Nullable private AttributeStatement buildAttributeStatement(@Nonnull ProfileRequestContext profileRequestContext, @Nullable @NullableElements Collection<IdPAttribute> attributes) throws AttributeEncodingException Builds 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
-
findExistingAttribute
@Nullable private Attribute findExistingAttribute(@Nonnull AttributeStatement statement, @Nonnull Attribute newAttribute) Find a matchingAttributein the statement, if any.- Parameters:
statement- input statementnewAttribute- the attribute to match- Returns:
- a match, or null
-
encodeAttribute
private void encodeAttribute(@Nonnull AttributeTranscoderRegistry registry, @Nonnull ProfileRequestContext profileRequestContext, @Nonnull IdPAttribute attribute, @Nonnull Collection<Attribute> results) throws AttributeEncodingException Encodes aIdPAttributeinto zero or moreAttributeobjects 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
-