Package org.pac4j.saml.transport
Class Pac4jHTTPArtifactDecoder
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.messaging.decoder.AbstractMessageDecoder<org.opensaml.saml.common.SAMLObject>
-
- org.pac4j.saml.transport.Pac4jHTTPArtifactDecoder
-
- All Implemented Interfaces:
net.shibboleth.utilities.java.support.component.Component,net.shibboleth.utilities.java.support.component.DestructableComponent,net.shibboleth.utilities.java.support.component.InitializableComponent,net.shibboleth.utilities.java.support.component.UnmodifiableComponent,org.opensaml.messaging.decoder.MessageDecoder<org.opensaml.saml.common.SAMLObject>,org.opensaml.saml.common.binding.decoding.SAMLMessageDecoder
public class Pac4jHTTPArtifactDecoder extends org.opensaml.messaging.decoder.AbstractMessageDecoder<org.opensaml.saml.common.SAMLObject> implements org.opensaml.saml.common.binding.decoding.SAMLMessageDecoderDecoder for the artifact binding: it's like the originalHTTPArtifactDecoderbut using a web context instead of the JEE HTTP servlet request.- Since:
- 3.8.0
- Author:
- Jerome LELEU
-
-
Constructor Summary
Constructors Constructor Description Pac4jHTTPArtifactDecoder()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecode()protected voiddoDecode()protected voiddoDestroy()protected voiddoInitialize()org.opensaml.saml.saml2.binding.artifact.SAML2ArtifactBuilderFactorygetArtifactBuilderFactory()Get the SAML 2 artifact builder factory.org.opensaml.saml.common.binding.EndpointResolver<org.opensaml.saml.saml2.metadata.ArtifactResolutionService>getArtifactEndpointResolver()Get the artifact endpoint resolver.org.opensaml.saml.common.binding.BindingDescriptorgetBindingDescriptor()Get an optionalBindingDescriptorto inject intoSAMLBindingContextcreated.StringgetBindingURI()net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategygetIdentifierGenerationStrategy()Get the identifier generation strategy.protected org.opensaml.core.xml.XMLObjectgetMessageToLog()Get the XMLObject which will be logged as the protocol message.net.shibboleth.utilities.java.support.xml.ParserPoolgetParserPool()Gets the parser pool used to deserialize incoming messages.QNamegetPeerEntityRole()Get the peer entity roleQName.org.opensaml.saml.metadata.resolver.RoleDescriptorResolvergetRoleDescriptorResolver()Get the role descriptor resolver.net.shibboleth.utilities.java.support.resolver.Resolver<String,net.shibboleth.utilities.java.support.resolver.CriteriaSet>getSelfEntityIDResolver()Get the resolver for the self entityID.org.opensaml.soap.client.SOAPClientgetSOAPClient()Get the SOAP client instance.StringgetSOAPClientSecurityConfigurationProfileId()Get the SOAP client security configuration profile ID to use.StringgetSOAPPipelineName()Get the name of the specific SOAP client message pipeline to use, for example withPipelineFactoryHttpSOAPClient.protected voidlogDecodedMessage()Log the decoded message to the protocol message logger.protected voidpopulateBindingContext(org.opensaml.messaging.context.MessageContext<org.opensaml.saml.common.SAMLObject> messageContext)Populate the context which carries information specific to this binding.voidsetArtifactBuilderFactory(org.opensaml.saml.saml2.binding.artifact.SAML2ArtifactBuilderFactory factory)Set the SAML 2 artifact builder factory.voidsetArtifactEndpointResolver(org.opensaml.saml.common.binding.EndpointResolver<org.opensaml.saml.saml2.metadata.ArtifactResolutionService> resolver)Set the artifact endpoint resolver.voidsetBindingDescriptor(org.opensaml.saml.common.binding.BindingDescriptor descriptor)Set an optionalBindingDescriptorto inject intoSAMLBindingContextcreated.voidsetIdentifierGenerationStrategy(net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy strategy)Set the identifier generation strategy.voidsetParserPool(net.shibboleth.utilities.java.support.xml.ParserPool pool)Sets the parser pool used to deserialize incoming messages.voidsetPeerEntityRole(QName role)Set the peer entity roleQName.voidsetRoleDescriptorResolver(org.opensaml.saml.metadata.resolver.RoleDescriptorResolver resolver)Set the role descriptor resolver.voidsetSelfEntityIDResolver(net.shibboleth.utilities.java.support.resolver.Resolver<String,net.shibboleth.utilities.java.support.resolver.CriteriaSet> resolver)Set the resolver for the self entityID.voidsetSOAPClient(org.opensaml.soap.client.SOAPClient client)Set the SOAP client instance.voidsetSOAPClientSecurityConfigurationProfileId(String profileId)Set the SOAP client security configuration profile ID to use.voidsetSOAPPipelineName(String name)Set the name of the specific SOAP client message pipeline to use, for example withPipelineFactoryHttpSOAPClient.voidsetWebContext(WebContext webContext)-
Methods inherited from class org.opensaml.messaging.decoder.AbstractMessageDecoder
getMessageContext, setMessageContext
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, 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.DestructableComponent
destroy, isDestroyed
-
-
-
-
Method Detail
-
decode
public void decode() throws org.opensaml.messaging.decoder.MessageDecodingException- Specified by:
decodein interfaceorg.opensaml.messaging.decoder.MessageDecoder<org.opensaml.saml.common.SAMLObject>- Overrides:
decodein classorg.opensaml.messaging.decoder.AbstractMessageDecoder<org.opensaml.saml.common.SAMLObject>- Throws:
org.opensaml.messaging.decoder.MessageDecodingException
-
getParserPool
@Nonnull public net.shibboleth.utilities.java.support.xml.ParserPool getParserPool()
Gets the parser pool used to deserialize incoming messages.- Returns:
- parser pool used to deserialize incoming messages
-
setParserPool
public void setParserPool(@Nonnull net.shibboleth.utilities.java.support.xml.ParserPool pool)
Sets the parser pool used to deserialize incoming messages.- Parameters:
pool- parser pool used to deserialize incoming messages
-
doDestroy
protected void doDestroy()
- Overrides:
doDestroyin classorg.opensaml.messaging.decoder.AbstractMessageDecoder<org.opensaml.saml.common.SAMLObject>
-
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
-
getIdentifierGenerationStrategy
@NonnullAfterInit public net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy getIdentifierGenerationStrategy()
Get the identifier generation strategy.- Returns:
- Returns the identifier generation strategy
-
setIdentifierGenerationStrategy
public void setIdentifierGenerationStrategy(@Nullable net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy strategy)
Set the identifier generation strategy.- Parameters:
strategy- the identifier generation strategy
-
getSelfEntityIDResolver
@NonnullAfterInit public net.shibboleth.utilities.java.support.resolver.Resolver<String,net.shibboleth.utilities.java.support.resolver.CriteriaSet> getSelfEntityIDResolver()
Get the resolver for the self entityID.- Returns:
- the resolver
-
setSelfEntityIDResolver
public void setSelfEntityIDResolver(@Nonnull net.shibboleth.utilities.java.support.resolver.Resolver<String,net.shibboleth.utilities.java.support.resolver.CriteriaSet> resolver)
Set the resolver for the self entityID.- Parameters:
resolver- the resolver instance
-
getPeerEntityRole
@NonnullAfterInit public QName getPeerEntityRole()
Get the peer entity roleQName.- Returns:
- the peer entity role
-
setPeerEntityRole
public void setPeerEntityRole(@Nonnull QName role)
Set the peer entity roleQName.- Parameters:
role- the peer entity role
-
getArtifactEndpointResolver
@NonnullAfterInit public org.opensaml.saml.common.binding.EndpointResolver<org.opensaml.saml.saml2.metadata.ArtifactResolutionService> getArtifactEndpointResolver()
Get the artifact endpoint resolver.- Returns:
- the endpoint resolver
-
setArtifactEndpointResolver
public void setArtifactEndpointResolver(@Nullable org.opensaml.saml.common.binding.EndpointResolver<org.opensaml.saml.saml2.metadata.ArtifactResolutionService> resolver)
Set the artifact endpoint resolver.- Parameters:
resolver- the new resolver
-
getRoleDescriptorResolver
@NonnullAfterInit public org.opensaml.saml.metadata.resolver.RoleDescriptorResolver getRoleDescriptorResolver()
Get the role descriptor resolver.Must be capable of resolving descriptors based on
ArtifactCriterion.- Returns:
- the role descriptor resolver
-
setRoleDescriptorResolver
public void setRoleDescriptorResolver(@Nullable org.opensaml.saml.metadata.resolver.RoleDescriptorResolver resolver)
Set the role descriptor resolver.Must be capable of resolving descriptors based on
ArtifactCriterion.- Parameters:
resolver- the role descriptor resolver
-
getArtifactBuilderFactory
@NonnullAfterInit public org.opensaml.saml.saml2.binding.artifact.SAML2ArtifactBuilderFactory getArtifactBuilderFactory()
Get the SAML 2 artifact builder factory.- Returns:
- the artifact builder factory in use
-
setArtifactBuilderFactory
public void setArtifactBuilderFactory(@Nullable org.opensaml.saml.saml2.binding.artifact.SAML2ArtifactBuilderFactory factory)
Set the SAML 2 artifact builder factory.- Parameters:
factory- the artifact builder factory
-
getSOAPClient
@NonnullAfterInit public org.opensaml.soap.client.SOAPClient getSOAPClient()
Get the SOAP client instance.- Returns:
- the SOAP client
-
setSOAPClient
public void setSOAPClient(@Nonnull org.opensaml.soap.client.SOAPClient client)
Set the SOAP client instance.- Parameters:
client- the SOAP client
-
getSOAPPipelineName
@Nullable public String getSOAPPipelineName()
Get the name of the specific SOAP client message pipeline to use, for example withPipelineFactoryHttpSOAPClient.- Returns:
- the pipeline name, or null
-
setSOAPPipelineName
public void setSOAPPipelineName(@Nullable String name)
Set the name of the specific SOAP client message pipeline to use, for example withPipelineFactoryHttpSOAPClient.- Parameters:
name- the pipeline name, or null
-
getSOAPClientSecurityConfigurationProfileId
@Nullable public String getSOAPClientSecurityConfigurationProfileId()
Get the SOAP client security configuration profile ID to use.- Returns:
- the client security configuration profile ID, or null
-
setSOAPClientSecurityConfigurationProfileId
@Nonnull public void setSOAPClientSecurityConfigurationProfileId(@Nullable String profileId)
Set the SOAP client security configuration profile ID to use.- Parameters:
profileId- the profile ID, or null
-
getBindingURI
@Nonnull @NotEmpty public String getBindingURI()
- Specified by:
getBindingURIin interfaceorg.opensaml.saml.common.binding.decoding.SAMLMessageDecoder
-
getBindingDescriptor
@Nullable public org.opensaml.saml.common.binding.BindingDescriptor getBindingDescriptor()
Get an optionalBindingDescriptorto inject intoSAMLBindingContextcreated.- Returns:
- binding descriptor
-
setBindingDescriptor
public void setBindingDescriptor(@Nullable org.opensaml.saml.common.binding.BindingDescriptor descriptor)
Set an optionalBindingDescriptorto inject intoSAMLBindingContextcreated.- Parameters:
descriptor- a binding descriptor
-
doDecode
protected void doDecode() throws org.opensaml.messaging.decoder.MessageDecodingException- Specified by:
doDecodein classorg.opensaml.messaging.decoder.AbstractMessageDecoder<org.opensaml.saml.common.SAMLObject>- Throws:
org.opensaml.messaging.decoder.MessageDecodingException
-
populateBindingContext
protected void populateBindingContext(org.opensaml.messaging.context.MessageContext<org.opensaml.saml.common.SAMLObject> messageContext)
Populate the context which carries information specific to this binding.- Parameters:
messageContext- the current message context
-
logDecodedMessage
protected void logDecodedMessage()
Log the decoded message to the protocol message logger.
-
getMessageToLog
protected org.opensaml.core.xml.XMLObject getMessageToLog()
Get the XMLObject which will be logged as the protocol message.- Returns:
- the XMLObject message considered to be the protocol message for logging purposes
-
setWebContext
public void setWebContext(@Nullable WebContext webContext)
-
-