public final class SAMLBindingSupport extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
checkRelayState(String relayState)
Checks that the relay state is 80 bytes or less if it is not null.
|
static String |
getActualReceiverEndpointURI(org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext,
HttpServletRequest request)
Extract the transport endpoint URI at which this message was received.
|
static URI |
getEndpointURL(org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
Get the response URL from the relying party endpoint.
|
static String |
getIntendedDestinationEndpointURI(org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
Extract the message information which indicates to what receiver endpoint URI the
SAML message was intended to be delivered.
|
static String |
getRelayState(org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
Get the SAML protocol relay state from a message context.
|
static boolean |
isIntendedDestinationEndpointURIRequired(org.opensaml.messaging.context.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(org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
Determine whether the SAML message represented by the message context is digitally signed.
|
static void |
setRelayState(org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext,
String relayState)
Set the SAML protocol relay state on a message context.
|
static void |
setSAML1ResponseRecipient(SAMLObject outboundMessage,
String endpointURL)
Sets the destination attribute on the outbound message if it is a
ResponseAbstractType message. |
static void |
setSAML2Destination(SAMLObject outboundMessage,
String endpointURL)
Sets the destination attribute on an outbound message if it is either a
RequestAbstractType or a
StatusResponseType message. |
@Nullable @NotEmpty public static String getRelayState(@Nonnull org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
messageContext
- the message context on which to operatepublic static void setRelayState(@Nonnull org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext, @Nullable String relayState)
messageContext
- the message context on which to operaterelayState
- the relay state to setpublic static boolean checkRelayState(@Nullable String relayState)
relayState
- relay state to check@Nonnull public static URI getEndpointURL(@Nonnull org.opensaml.messaging.context.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 String endpointURL)
ResponseAbstractType
message.outboundMessage
- outbound SAML messageendpointURL
- destination endpointpublic static void setSAML2Destination(@Nonnull SAMLObject outboundMessage, @Nonnull @NotEmpty String endpointURL)
RequestAbstractType
or a
StatusResponseType
message.outboundMessage
- outbound SAML messageendpointURL
- destination endpointpublic static boolean isMessageSigned(@Nonnull org.opensaml.messaging.context.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 org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
messageContext
- current SAML message context@Nullable public static String getIntendedDestinationEndpointURI(@Nonnull org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext) throws org.opensaml.messaging.MessageException
messageContext
- the SAML message context being processedorg.opensaml.messaging.MessageException
- thrown if the message is not an instance of SAML message that
could be processed by the decoder@Nonnull public static String getActualReceiverEndpointURI(@Nonnull org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext, @Nonnull HttpServletRequest request) throws org.opensaml.messaging.MessageException
messageContext
- current message contextrequest
- the HttpServletRequest being evaluatedorg.opensaml.messaging.MessageException
- thrown if the endpoint can not be looked up from the message
context and converted to a string representationCopyright © 2016 JBoss by Red Hat. All rights reserved.