public final class SAMLBindingSupport
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOG
Logger.
|
| Modifier | Constructor and Description |
|---|---|
private |
SAMLBindingSupport()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkRelayState(java.lang.String relayState)
Checks that the relay state is 80 bytes or less if it is not null.
|
static java.lang.String |
getActualReceiverEndpointURI(MessageContext<SAMLObject> messageContext,
javax.servlet.http.HttpServletRequest request)
Extract the transport endpoint URI at which this message was received.
|
static java.net.URI |
getEndpointURL(MessageContext<SAMLObject> messageContext)
Get the response URL from the relying party endpoint.
|
static java.lang.String |
getIntendedDestinationEndpointURI(MessageContext<SAMLObject> messageContext)
Extract the message information which indicates to what receiver endpoint URI the
SAML message was intended to be delivered.
|
static java.lang.String |
getRelayState(MessageContext<SAMLObject> messageContext)
Get the SAML protocol relay state from a message context.
|
static boolean |
isIntendedDestinationEndpointURIRequired(MessageContext<SAMLObject> messageContext)
Determine whether the binding in use requires the presence within the message
of information indicating the intended message destination endpoint URI.
|
static boolean |
isMessageSigned(MessageContext<SAMLObject> messageContext)
Determine whether the SAML message represented by the message context is digitally signed.
|
static void |
setRelayState(MessageContext<SAMLObject> messageContext,
java.lang.String relayState)
Set the SAML protocol relay state on a message context.
|
static void |
setSAML1ResponseRecipient(SAMLObject outboundMessage,
java.lang.String endpointURL)
Sets the destination attribute on the outbound message if it is a
ResponseAbstractType message. |
static void |
setSAML2Destination(SAMLObject outboundMessage,
java.lang.String endpointURL)
Sets the destination attribute on an outbound message if it is either a
RequestAbstractType or a
StatusResponseType message. |
@Nullable
@NotEmpty
public static java.lang.String getRelayState(@Nonnull
MessageContext<SAMLObject> messageContext)
messageContext - the message context on which to operatepublic static void setRelayState(@Nonnull
MessageContext<SAMLObject> messageContext,
@Nullable
java.lang.String relayState)
messageContext - the message context on which to operaterelayState - the relay state to setpublic static boolean checkRelayState(@Nullable
java.lang.String relayState)
relayState - relay state to check@Nonnull
public static java.net.URI getEndpointURL(@Nonnull
MessageContext<SAMLObject> messageContext)
throws BindingException
messageContext - current message contextBindingException - throw if no relying party endpoint is availablepublic static void setSAML1ResponseRecipient(@Nonnull
SAMLObject outboundMessage,
@Nonnull @NotEmpty
java.lang.String endpointURL)
ResponseAbstractType message.outboundMessage - outbound SAML messageendpointURL - destination endpointpublic static void setSAML2Destination(@Nonnull
SAMLObject outboundMessage,
@Nonnull @NotEmpty
java.lang.String endpointURL)
RequestAbstractType or a
StatusResponseType message.outboundMessage - outbound SAML messageendpointURL - destination endpointpublic static boolean isMessageSigned(@Nonnull
MessageContext<SAMLObject> messageContext)
First the SAML protocol message is examined as to whether an XML signature is present.
If not, then the presence of a binding signature is evaluated by looking at
SAMLBindingContext.hasBindingSignature().
messageContext - current message contextpublic static boolean isIntendedDestinationEndpointURIRequired(@Nonnull
MessageContext<SAMLObject> messageContext)
messageContext - current SAML message context@Nullable
public static java.lang.String getIntendedDestinationEndpointURI(@Nonnull
MessageContext<SAMLObject> messageContext)
throws MessageException
messageContext - the SAML message context being processedMessageException - thrown if the message is not an instance of SAML message that
could be processed by the decoder@Nonnull
public static java.lang.String getActualReceiverEndpointURI(@Nonnull
MessageContext<SAMLObject> messageContext,
@Nonnull
javax.servlet.http.HttpServletRequest request)
throws MessageException
messageContext - current message contextrequest - the HttpServletRequest being evaluatedMessageException - thrown if the endpoint can not be looked up from the message
context and converted to a string representation