Class BaseIdPInitiatedSSORequestMessageDecoder
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
org.opensaml.messaging.decoder.AbstractMessageDecoder
org.opensaml.messaging.decoder.servlet.AbstractHttpServletRequestMessageDecoder
net.shibboleth.idp.saml.profile.impl.BaseIdPInitiatedSSORequestMessageDecoder
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,UnmodifiableComponent
,MessageDecoder
,HttpServletRequestMessageDecoder
- Direct Known Subclasses:
IdPInitiatedSSORequestMessageDecoder
,IdPInitiatedSSORequestMessageDecoder
@NotThreadSafe
public abstract class BaseIdPInitiatedSSORequestMessageDecoder
extends AbstractHttpServletRequestMessageDecoder
Decodes an incoming Shibboleth Authentication Request message.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BindingDescriptor
OptionalBindingDescriptor
to inject intoSAMLBindingContext
created.private final IdentifierGenerationStrategy
ID generator.private final org.slf4j.Logger
Class logger.private final org.slf4j.Logger
Used to log protocol messages.static final String
Name of the query parameter carrying the service provider entity ID: "providerId" .static final String
Name of the query parameter carrying the service provider's assertion consumer service URL: "shire" .static final String
Name of the query parameter carrying the service provider's target/RelayState information: "target" .static final String
Name of the query parameter carrying the current time at the service provider: "time" . -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected IdPInitiatedSSORequest
Build a new IdP-initiated request structure from the inbound HTTP request.void
decode()
protected String
getAcsUrl
(javax.servlet.http.HttpServletRequest request) Gets the assertion consumer service URL for the service provider.Get an optionalBindingDescriptor
to inject intoSAMLBindingContext
created.protected String
getEntityId
(javax.servlet.http.HttpServletRequest request) Gets the entity ID of the service provider.protected String
Construct a message ID for the request.protected abstract String
Get the string representation of what will be logged as the protocol message.protected String
getTarget
(javax.servlet.http.HttpServletRequest request) Gets the opaque relay state sent by the service provider.protected Instant
getTime
(javax.servlet.http.HttpServletRequest request) Gets the current time at the SP, if set.protected void
Log the decoded message to the protocol message logger.void
setBindingDescriptor
(BindingDescriptor descriptor) Set an optionalBindingDescriptor
to inject intoSAMLBindingContext
created.Methods inherited from class org.opensaml.messaging.decoder.servlet.AbstractHttpServletRequestMessageDecoder
doInitialize, getHttpServletRequest, getHttpServletRequestSupplier, setHttpServletRequest, setHttpServletRequestSupplier
Methods inherited from class org.opensaml.messaging.decoder.AbstractMessageDecoder
doDecode, doDestroy, 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
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
Methods inherited from interface org.opensaml.messaging.decoder.MessageDecoder
getMessageContext
-
Field Details
-
PROVIDER_ID_PARAM
Name of the query parameter carrying the service provider entity ID: "providerId" .- See Also:
-
SHIRE_PARAM
Name of the query parameter carrying the service provider's assertion consumer service URL: "shire" .- See Also:
-
TARGET_PARAM
Name of the query parameter carrying the service provider's target/RelayState information: "target" .- See Also:
-
TIME_PARAM
Name of the query parameter carrying the current time at the service provider: "time" .- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
bindingDescriptor
OptionalBindingDescriptor
to inject intoSAMLBindingContext
created. -
protocolMessageLog
@Nonnull private final org.slf4j.Logger protocolMessageLogUsed to log protocol messages. -
idGenerator
ID generator.
-
-
Constructor Details
-
BaseIdPInitiatedSSORequestMessageDecoder
public BaseIdPInitiatedSSORequestMessageDecoder()
-
-
Method Details
-
getBindingDescriptor
Get an optionalBindingDescriptor
to inject intoSAMLBindingContext
created.- Returns:
- binding descriptor
-
setBindingDescriptor
Set an optionalBindingDescriptor
to inject intoSAMLBindingContext
created.- Parameters:
descriptor
- a binding descriptor
-
decode
- Specified by:
decode
in interfaceMessageDecoder
- Overrides:
decode
in classAbstractHttpServletRequestMessageDecoder
- Throws:
MessageDecodingException
-
buildIdPInitiatedSSORequest
@Nonnull protected IdPInitiatedSSORequest buildIdPInitiatedSSORequest() throws MessageDecodingExceptionBuild a new IdP-initiated request structure from the inbound HTTP request.- Returns:
- the new SSO request structure
- Throws:
MessageDecodingException
- if the request doesn't contain an entityID
-
getEntityId
@Nonnull @NotEmpty protected String getEntityId(@Nonnull javax.servlet.http.HttpServletRequest request) throws MessageDecodingException Gets the entity ID of the service provider.- Parameters:
request
- current HTTP request- Returns:
- the entity ID of the service provider
- Throws:
MessageDecodingException
- thrown if the request does not contain a service provider entity ID
-
getAcsUrl
Gets the assertion consumer service URL for the service provider.- Parameters:
request
- current HTTP request- Returns:
- the assertion consumer service URL, may be null if none is given in the request
-
getTarget
Gets the opaque relay state sent by the service provider.- Parameters:
request
- current HTTP request- Returns:
- the relay state, or null if the service provider did not send one
-
getTime
@Nullable protected Instant getTime(@Nonnull javax.servlet.http.HttpServletRequest request) throws MessageDecodingException Gets the current time at the SP, if set.- Parameters:
request
- current HTTP request- Returns:
- the time sent by the service provider, or null
- Throws:
MessageDecodingException
- thrown if the time parameter given by the service provider is non-numeric or a negative time
-
logDecodedMessage
protected void logDecodedMessage()Log the decoded message to the protocol message logger. -
getMessageID
Construct a message ID for the request.- Returns:
- the message ID to use
-
getMessageToLog
Get the string representation of what will be logged as the protocol message.- Returns:
- the string representing the protocol message for logging purposes
-