public abstract class BaseSAMLMessageDecoder extends BaseMessageDecoder implements SAMLMessageDecoder
Constructor and Description |
---|
BaseSAMLMessageDecoder()
Constructor.
|
BaseSAMLMessageDecoder(ParserPool pool)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkEndpointURI(SAMLMessageContext messageContext)
Check the validity of the SAML protocol message receiver endpoint against
requirements indicated in the message.
|
protected boolean |
compareEndpointURIs(String messageDestination,
String receiverEndpoint)
Compare the message endpoint URI's specified.
|
protected String |
getActualReceiverEndpointURI(SAMLMessageContext messageContext)
Extract the transport endpoint at which this message was received.
|
protected abstract String |
getIntendedDestinationEndpointURI(SAMLMessageContext samlMsgCtx)
Extract the message information which indicates to what receiver endpoint URI the
SAML message was intended to be delivered.
|
URIComparator |
getURIComparator()
Get the
URIComparator to use in compareEndpointURIs(String, String) . |
protected abstract boolean |
isIntendedDestinationEndpointURIRequired(SAMLMessageContext samlMsgCtx)
Determine whether the binding implemented by the decoder requires the presence within the message
of information indicating the intended message destination endpoint URI.
|
protected boolean |
isMessageSigned(SAMLMessageContext messageContext)
Determine whether the SAML message represented by the message context is digitally signed.
|
void |
setURIComparator(URIComparator comparator)
Set the
URIComparator to use in compareEndpointURIs(String, String) . |
decode, doDecode, getParserPool, logDecodedMessage, processSecurityPolicy, setParserPool, unmarshallMessage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBindingURI
decode
public BaseSAMLMessageDecoder()
public BaseSAMLMessageDecoder(ParserPool pool)
pool
- parser pool used to deserialize messagespublic void setURIComparator(URIComparator comparator)
URIComparator
to use in compareEndpointURIs(String, String)
.comparator
- The uriComparator to set.public URIComparator getURIComparator()
URIComparator
to use in compareEndpointURIs(String, String)
.protected boolean isMessageSigned(SAMLMessageContext messageContext)
The default behavior is to examine whether an XML signature is present on the SAML protocol message. Subclasses may augment or replace with binding-specific behavior.
messageContext
- current message contextprotected abstract boolean isIntendedDestinationEndpointURIRequired(SAMLMessageContext samlMsgCtx)
samlMsgCtx
- current SAML message contextprotected abstract String getIntendedDestinationEndpointURI(SAMLMessageContext samlMsgCtx) throws MessageDecodingException
samlMsgCtx
- the SAML message context being processedMessageDecodingException
- thrown if the message is not an instance of SAML message that
could be processed by the decoderprotected String getActualReceiverEndpointURI(SAMLMessageContext messageContext) throws MessageDecodingException
This default implementation assumes an underlying message context InTransport
type
of HttpServletRequestAdapter
and returns the string representation of the underlying
request URL as constructed via HttpServletRequest.getRequestURL()
.
Subclasses should override if binding-specific behavior or support for other transport
typs is required. In this case, see also compareEndpointURIs(String, String)
.
messageContext
- current message contextMessageDecodingException
- thrown if the endpoint can not be extracted from the message
context and converted to a string representationprotected boolean compareEndpointURIs(String messageDestination, String receiverEndpoint) throws MessageDecodingException
The comparison is performed using the configured instance of URIComparator
.
By default, the URL subtype of URI is supported, and the default comparator implementation used
is BasicURLComparator
. Other types of URI's may be supported by configuring a
different implementation of URIComparator
.
Subclasses should override if binding-specific behavior is required.
In this case, see also getActualReceiverEndpointURI(SAMLMessageContext)
.
messageDestination
- the intended message destination endpoint URIreceiverEndpoint
- the endpoint URI at which the message was receivedMessageDecodingException
- thrown if the endpoints specified are not equivalentprotected void checkEndpointURI(SAMLMessageContext messageContext) throws SecurityException, MessageDecodingException
messageContext
- current message contextSecurityException
- thrown if the message Destination attribute is invalid
with respect to the receiver's endpointMessageDecodingException
- thrown if there is a problem decoding and processing
the message Destination or receiver
endpoint informationCopyright © 2018 JBoss by Red Hat. All rights reserved.