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 anAttributeStatementand adds it to anAssertionreturned by a lookup strategy, by default in theInOutOperationContext.getOutboundMessageContext().If no
Responseexists, then anAssertiondirectly in the outbound message context will be used or createdThe
IdPAttributeset to be encoded is drawn from anAttributeContextreturned from a lookup strategy, by default located on theRelyingPartyContextbeneath the profile request context.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classAddAttributeStatementToAssertion.AssertionStrategyDefault strategy for obtaining assertion to modify.
-
Field Summary
Fields Modifier and Type Field Description private Function<ProfileRequestContext,Assertion>assertionLookupStrategyStrategy used to locate theAssertionto operate on.private org.slf4j.LoggerlogClass logger.
-
Constructor Summary
Constructors Constructor Description AddAttributeStatementToAssertion()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private 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)EncodesIdPAttributeinto zero or moreAttributeobjects if a proper encoder is available.private AttributefindExistingAttribute(AttributeStatement statement, Attribute newAttribute)Find a matchingAttributein the statement, if any.voidsetAssertionLookupStrategy(Function<ProfileRequestContext,Assertion> strategy)Set 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, 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 Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
assertionLookupStrategy
@Nonnull private Function<ProfileRequestContext,Assertion> assertionLookupStrategy
Strategy used to locate theAssertionto operate on.
-
-
Method Detail
-
setAssertionLookupStrategy
public void setAssertionLookupStrategy(@Nonnull Function<ProfileRequestContext,Assertion> strategy)Set the strategy used to locate theAssertionto operate on.- Parameters:
strategy- strategy used to locate theAssertionto operate on
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- 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 @NonnullElements Collection<Attribute> results) throws AttributeEncodingExceptionEncodesIdPAttributeinto 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
-
-