Class SAMLAddAttributeConsumingServiceHandler
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.messaging.handler.AbstractMessageHandler
-
- org.opensaml.saml.common.binding.impl.SAMLAddAttributeConsumingServiceHandler
-
- 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.messaging.handler.MessageHandler
public class SAMLAddAttributeConsumingServiceHandler extends org.opensaml.messaging.handler.AbstractMessageHandlerSAMLMessageHandlerthat attaches anAttributeConsumingServiceContextto theSAMLMetadataContextbased on the content of anAuthnRequestin the message context.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classSAMLAddAttributeConsumingServiceHandler.AuthnRequestLookupDefault lookup function that find a SAML 2AuthnRequest.
-
Field Summary
Fields Modifier and Type Field Description private Function<org.opensaml.messaging.context.MessageContext,org.opensaml.saml.saml2.core.AuthnRequest>authnRequestLookupStrategyLookup strategy for anAuthnRequestindex.private IntegerindexAttributeConsumingServiceindex - if specified.private org.slf4j.LoggerlogLogger.private Function<org.opensaml.messaging.context.MessageContext,org.opensaml.saml.common.messaging.context.SAMLMetadataContext>metadataContextLookupStrategyLookup strategy forSAMLMetadataContext.private List<org.opensaml.saml.saml2.metadata.RequestedAttribute>requestedAttributesRequestedAttributelist - if specified.
-
Constructor Summary
Constructors Constructor Description SAMLAddAttributeConsumingServiceHandler()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.opensaml.saml.saml2.metadata.AttributeConsumingServiceattributeConsumingServiceFromRequestedAttributes()Generate anAttributeConsumingServicefrom theRequestedAttributes.protected voiddoInvoke(org.opensaml.messaging.context.MessageContext messageContext)protected booleandoPreInvoke(org.opensaml.messaging.context.MessageContext messageContext)private List<org.opensaml.saml.saml2.metadata.RequestedAttribute>getRequestedAttributes(org.opensaml.saml.saml2.core.AuthnRequest authn)Grab theRequestedAttribute(if any) from theAuthnRequest.voidsetIndexLookupStrategy(Function<org.opensaml.messaging.context.MessageContext,org.opensaml.saml.saml2.core.AuthnRequest> strategy)Set the strategy to locate theAttributeConsumingServiceindex from theMessageContext.voidsetMetadataContextLookupStrategy(Function<org.opensaml.messaging.context.MessageContext,org.opensaml.saml.common.messaging.context.SAMLMetadataContext> strategy)Set the strategy to locate theSAMLMetadataContextfrom theMessageContext.-
Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doPostInvoke, doPostInvoke, getActivationCondition, getLogPrefix, invoke, setActivationCondition
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Logger.
-
metadataContextLookupStrategy
@Nonnull private Function<org.opensaml.messaging.context.MessageContext,org.opensaml.saml.common.messaging.context.SAMLMetadataContext> metadataContextLookupStrategy
Lookup strategy forSAMLMetadataContext.
-
authnRequestLookupStrategy
@Nonnull private Function<org.opensaml.messaging.context.MessageContext,org.opensaml.saml.saml2.core.AuthnRequest> authnRequestLookupStrategy
Lookup strategy for anAuthnRequestindex.
-
index
@Nullable private Integer index
AttributeConsumingServiceindex - if specified.
-
requestedAttributes
@Nullable private List<org.opensaml.saml.saml2.metadata.RequestedAttribute> requestedAttributes
RequestedAttributelist - if specified.
-
-
Method Detail
-
setMetadataContextLookupStrategy
public void setMetadataContextLookupStrategy(@Nonnull Function<org.opensaml.messaging.context.MessageContext,org.opensaml.saml.common.messaging.context.SAMLMetadataContext> strategy)Set the strategy to locate theSAMLMetadataContextfrom theMessageContext.- Parameters:
strategy- lookup strategy
-
setIndexLookupStrategy
public void setIndexLookupStrategy(@Nullable Function<org.opensaml.messaging.context.MessageContext,org.opensaml.saml.saml2.core.AuthnRequest> strategy)Set the strategy to locate theAttributeConsumingServiceindex from theMessageContext.- Parameters:
strategy- lookup strategy
-
doPreInvoke
protected boolean doPreInvoke(@Nonnull org.opensaml.messaging.context.MessageContext messageContext) throws org.opensaml.messaging.handler.MessageHandlerException- Overrides:
doPreInvokein classorg.opensaml.messaging.handler.AbstractMessageHandler- Throws:
org.opensaml.messaging.handler.MessageHandlerException
-
doInvoke
protected void doInvoke(@Nonnull org.opensaml.messaging.context.MessageContext messageContext) throws org.opensaml.messaging.handler.MessageHandlerException- Specified by:
doInvokein classorg.opensaml.messaging.handler.AbstractMessageHandler- Throws:
org.opensaml.messaging.handler.MessageHandlerException
-
attributeConsumingServiceFromRequestedAttributes
private org.opensaml.saml.saml2.metadata.AttributeConsumingService attributeConsumingServiceFromRequestedAttributes() throws org.opensaml.messaging.handler.MessageHandlerExceptionGenerate anAttributeConsumingServicefrom theRequestedAttributes.- Returns:
- a suitable AttributeConsumingService
- Throws:
org.opensaml.messaging.handler.MessageHandlerException- when the cloning failed
-
getRequestedAttributes
private List<org.opensaml.saml.saml2.metadata.RequestedAttribute> getRequestedAttributes(org.opensaml.saml.saml2.core.AuthnRequest authn)
Grab theRequestedAttribute(if any) from theAuthnRequest.- Parameters:
authn- the request to interrogate- Returns:
- null or the list.
-
-