Class HTTPPostBinding
Supports the HTTP POST binding.
Inheritance
Inherited Members
Namespace: ComponentSpace.SAML2.Bindings
Assembly: ComponentSpace.Saml2.dll
Syntax
public static class HTTPPostBinding
Remarks
Refer to the Bindings for the OASIS Security Assertion Markup Language (SAML) V2.0 specification for further details.
Properties
HTMLFormTarget
Gets or sets the HTML form target.
Declaration
public static string HTMLFormTarget { get; set; }
Property Value
Type | Description |
---|---|
System.String | The HTML form action target. |
Remarks
The target may be: _self, _blank, _parent or _top. The default is _self.
HTMLFormTemplate
Gets or sets the HTML form template that's used when posting.
Declaration
public static string HTMLFormTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.String | The HTML form template that's used when posting. |
Methods
CreateContentSecurityPolicyHashedScriptSource()
Creates a SHA-256 hashed script source for inclusion in a Content-Security-Policy header.
Declaration
public static string CreateContentSecurityPolicyHashedScriptSource()
Returns
Type | Description |
---|---|
System.String | The hashed script source. |
CreateRequestPostData(XmlElement, String)
Creates HTTP POST data from the SAML request and optional relay state.
Declaration
public static string CreateRequestPostData(XmlElement samlMessage, string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | samlMessage | The SAML request. |
System.String | relayState | The relay state or |
Returns
Type | Description |
---|---|
System.String | The HTTP POST data. |
CreateResponsePostData(XmlElement, String)
Creates HTTP POST data from the SAML response and optional relay state.
Declaration
public static string CreateResponsePostData(XmlElement samlMessage, string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | samlMessage | The SAML response. |
System.String | relayState | The relay state or |
Returns
Type | Description |
---|---|
System.String | The HTTP POST data. |
ReceiveMessage(HttpRequestBase, out XmlElement, out String, out Boolean)
Receives the SAML request or response and optional relay state data by extracting them from the posted form.
Declaration
public static void ReceiveMessage(HttpRequestBase httpRequest, out XmlElement samlMessage, out string relayState, out bool isRequest)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequestBase | httpRequest | The HTTP request containing the posted form. |
System.Xml.XmlElement | samlMessage | The returned SAML request or response. |
System.String | relayState | The returned relay state or |
System.Boolean | isRequest |
|
Exceptions
Type | Condition |
---|---|
SAMLBindingException | Thrown when the receive fails. |
See Also
ReceiveRequest(HttpRequestBase, out XmlElement, out String)
Receives the SAML request and optional relay state data by extracting them from the posted form.
Declaration
public static void ReceiveRequest(HttpRequestBase httpRequest, out XmlElement samlMessage, out string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequestBase | httpRequest | The HTTP request containing the posted form. |
System.Xml.XmlElement | samlMessage | The returned SAML request. |
System.String | relayState | The returned relay state or |
Exceptions
Type | Condition |
---|---|
SAMLBindingException | Thrown when the receive fails. |
See Also
ReceiveResponse(HttpRequestBase, out XmlElement, out String)
Receives the SAML response and optional relay state data by extracting them from the posted form.
Declaration
public static void ReceiveResponse(HttpRequestBase httpRequest, out XmlElement samlMessage, out string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequestBase | httpRequest | The HTTP request containing the posted form. |
System.Xml.XmlElement | samlMessage | The returned SAML response. |
System.String | relayState | The returned relay state or |
Exceptions
Type | Condition |
---|---|
SAMLBindingException | Thrown when the receive fails. |
See Also
SendRequest(Stream, String, XmlElement, String)
Sends the SAML request and optional relay state data as hidden controls in a posted form.
Declaration
public static void SendRequest(Stream stream, string targetURL, XmlElement samlMessage, string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to which the form is written. |
System.String | targetURL | The target URL for the posted form. |
System.Xml.XmlElement | samlMessage | The SAML request. |
System.String | relayState | The relay state or |
Exceptions
Type | Condition |
---|---|
SAMLBindingException | Thrown when the send fails. |
SendRequest(HttpResponseBase, String, XmlElement, String)
Sends the SAML request and optional relay state data as hidden controls in a posted form.
Declaration
public static void SendRequest(HttpResponseBase httpResponse, string targetURL, XmlElement samlMessage, string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponseBase | httpResponse | The HTTP response that will return the form to post. |
System.String | targetURL | The target URL for the posted form. |
System.Xml.XmlElement | samlMessage | The SAML request. |
System.String | relayState | The relay state or |
Exceptions
Type | Condition |
---|---|
SAMLBindingException | Thrown when the send fails. |
SendResponse(Stream, String, XmlElement, String)
Sends the SAML response and optional relay state data as hidden controls in a posted form.
Declaration
public static void SendResponse(Stream stream, string targetURL, XmlElement samlMessage, string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to which the form is written. |
System.String | targetURL | The target URL for the posted form. |
System.Xml.XmlElement | samlMessage | The SAML response. |
System.String | relayState | The relay state or |
Exceptions
Type | Condition |
---|---|
SAMLBindingException | Thrown when the send fails. |
SendResponse(HttpResponseBase, String, XmlElement, String)
Sends the SAML response and optional relay state data as hidden controls in a posted form.
Declaration
public static void SendResponse(HttpResponseBase httpResponse, string targetURL, XmlElement samlMessage, string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponseBase | httpResponse | The HTTP response that will return the form to post. |
System.String | targetURL | The target URL for the posted form. |
System.Xml.XmlElement | samlMessage | The SAML response. |
System.String | relayState | The relay state or |
Exceptions
Type | Condition |
---|---|
SAMLBindingException | Thrown when the send fails. |