Show / Hide Table of Contents

Class SAMLHttpRequest

Provides a mechanism for receiving a SAML protocol message through a non-standard HTTP request.

Inheritance
object
HttpRequestBase
SAMLHttpRequest
Implements
IDisposable
Inherited Members
HttpRequestBase.Abort()
HttpRequestBase.BinaryRead(int)
HttpRequestBase.GetBufferedInputStream()
HttpRequestBase.GetBufferlessInputStream()
HttpRequestBase.GetBufferlessInputStream(bool)
HttpRequestBase.InsertEntityBody()
HttpRequestBase.InsertEntityBody(byte[], int, int)
HttpRequestBase.MapImageCoordinates(string)
HttpRequestBase.MapRawImageCoordinates(string)
HttpRequestBase.MapPath(string)
HttpRequestBase.MapPath(string, string, bool)
HttpRequestBase.ValidateInput()
HttpRequestBase.SaveAs(string, bool)
HttpRequestBase.AcceptTypes
HttpRequestBase.ApplicationPath
HttpRequestBase.AnonymousID
HttpRequestBase.AppRelativeCurrentExecutionFilePath
HttpRequestBase.Browser
HttpRequestBase.HttpChannelBinding
HttpRequestBase.ClientCertificate
HttpRequestBase.ContentEncoding
HttpRequestBase.ContentType
HttpRequestBase.CurrentExecutionFilePath
HttpRequestBase.CurrentExecutionFilePathExtension
HttpRequestBase.FilePath
HttpRequestBase.Files
HttpRequestBase.Filter
HttpRequestBase.IsAuthenticated
HttpRequestBase.IsLocal
HttpRequestBase.LogonUserIdentity
HttpRequestBase.Params
HttpRequestBase.PathInfo
HttpRequestBase.PhysicalApplicationPath
HttpRequestBase.PhysicalPath
HttpRequestBase.ReadEntityBodyMode
HttpRequestBase.RequestContext
HttpRequestBase.TimedOutToken
HttpRequestBase.TlsTokenBindingInfo
HttpRequestBase.TotalBytes
HttpRequestBase.Unvalidated
HttpRequestBase.UrlReferrer
HttpRequestBase.UserAgent
HttpRequestBase.UserLanguages
HttpRequestBase.UserHostAddress
HttpRequestBase.UserHostName
HttpRequestBase.this[string]
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: ComponentSpace.SAML2.Utility
Assembly: ComponentSpace.Saml2.dll
Syntax
public class SAMLHttpRequest : HttpRequestBase, IDisposable

Constructors

SAMLHttpRequest()

Initializes a new instance of the SAMLHttpRequest class.

Declaration
public SAMLHttpRequest()

SAMLHttpRequest(string, string, bool, Uri, HttpCookieCollection)

Initializes a new instance of the SAMLHttpRequest class.

The SAML message is received using the HTTP-Post binding.

Declaration
public SAMLHttpRequest(string samlMessage, string relayState, bool isSAMLRequest, Uri url, HttpCookieCollection cookies)
Parameters
Type Name Description
string samlMessage

The SAML message base-64 encoded string.

string relayState

The relay state or null if none

bool isSAMLRequest

The flag indicating whether this is a SAML request or response.

Uri url

The URL used to receive the SAML message.

HttpCookieCollection cookies

The HTTP cookies or null if none.

SAMLHttpRequest(string, string, Uri, HttpCookieCollection)

Initializes a new instance of the SAMLHttpRequest class.

The SAML message is received using the HTTP-Post binding.

Declaration
public SAMLHttpRequest(string samlMessage, string relayState, Uri url, HttpCookieCollection cookies)
Parameters
Type Name Description
string samlMessage

The SAML message base-64 encoded string.

string relayState

The relay state or null if none.

Uri url

The URL used to receive the SAML message.

HttpCookieCollection cookies

The HTTP cookies or null if none.

SAMLHttpRequest(Uri, HttpCookieCollection)

Initializes a new instance of the SAMLHttpRequest class.

The SAML message is received using the HTTP-Redirect binding.

Declaration
public SAMLHttpRequest(Uri url, HttpCookieCollection cookies)
Parameters
Type Name Description
Uri url

The URL including the SAML query string parameters.

HttpCookieCollection cookies

The HTTP cookies or null if none.

SAMLHttpRequest(XmlElement, string, bool, AsymmetricAlgorithm, string, Uri, HttpCookieCollection)

Initializes a new instance of the SAMLHttpRequest class.

The SAML message is received using the HTTP-Redirect binding.

Declaration
public SAMLHttpRequest(XmlElement samlMessage, string relayState, bool isSAMLRequest, AsymmetricAlgorithm key, string signatureAlgorithm, Uri url, HttpCookieCollection cookies)
Parameters
Type Name Description
XmlElement samlMessage

The SAML message XML.

string relayState

The relay state or null if none

bool isSAMLRequest

The flag indicating whether this is a SAML request or response.

AsymmetricAlgorithm key

The key to generate the signature or null if no signature is to be generated.

string signatureAlgorithm

The signature algorithm or null to default to http://www.w3.org/2001/04/xmldsig-more#rsa-sha256.

Uri url

The URL used to receive the SAML message.

HttpCookieCollection cookies

The HTTP cookies or null if none.

SAMLHttpRequest(XmlElement, string, bool, Uri, HttpCookieCollection)

Initializes a new instance of the SAMLHttpRequest class.

The SAML message is received using the HTTP-Post binding.

Declaration
public SAMLHttpRequest(XmlElement samlMessage, string relayState, bool isSAMLRequest, Uri url, HttpCookieCollection cookies)
Parameters
Type Name Description
XmlElement samlMessage

The SAML message XML.

string relayState

The relay state or null if none.

bool isSAMLRequest

The flag indicating whether this is a SAML request or response.

Uri url

The URL used to receive the SAML message.

HttpCookieCollection cookies

The HTTP cookies or null if none.

SAMLHttpRequest(XmlElement, string, AsymmetricAlgorithm, string, Uri, HttpCookieCollection)

Initializes a new instance of the SAMLHttpRequest class.

The SAML message is received using the HTTP-Redirect binding.

Declaration
public SAMLHttpRequest(XmlElement samlMessage, string relayState, AsymmetricAlgorithm key, string signatureAlgorithm, Uri url, HttpCookieCollection cookies)
Parameters
Type Name Description
XmlElement samlMessage

The SAML message XML.

string relayState

The relay state or null if none

AsymmetricAlgorithm key

The key to generate the signature or null if no signature is to be generated.

string signatureAlgorithm

The signature algorithm or null to default to http://www.w3.org/2001/04/xmldsig-more#rsa-sha256.

Uri url

The URL used to receive the SAML message.

HttpCookieCollection cookies

The HTTP cookies or null if none.

SAMLHttpRequest(XmlElement, string, Uri, HttpCookieCollection)

Initializes a new instance of the SAMLHttpRequest class.

The SAML message is received using the HTTP-Post binding.

Declaration
public SAMLHttpRequest(XmlElement samlMessage, string relayState, Uri url, HttpCookieCollection cookies)
Parameters
Type Name Description
XmlElement samlMessage

The SAML message XML.

string relayState

The relay state or null if none.

Uri url

The URL used to receive the SAML message.

HttpCookieCollection cookies

The HTTP cookies or null if none.

Properties

ContentLength

Gets the content length of the HTTP request used to receive the SAML message.

Declaration
public override int ContentLength { get; }
Property Value
Type Description
int

The content length of the HTTP request used to receive the SAML message.

Overrides
HttpRequestBase.ContentLength

Cookies

Gets the collection of cookies.

Declaration
public override HttpCookieCollection Cookies { get; }
Property Value
Type Description
HttpCookieCollection

The collection of cookies.

Overrides
HttpRequestBase.Cookies

Form

Gets the form variables used to receive the SAML message.

Declaration
public override NameValueCollection Form { get; }
Property Value
Type Description
NameValueCollection

The form variables used to receive the SAML message.

Overrides
HttpRequestBase.Form

Headers

Gets the headers used to receive the SAML message.

Declaration
public override NameValueCollection Headers { get; }
Property Value
Type Description
NameValueCollection

The headers used to receive the SAML message.

Overrides
HttpRequestBase.Headers

HttpMethod

Gets the HTTP method (Get or Post) used to receive the SAML message.

Declaration
public override string HttpMethod { get; }
Property Value
Type Description
string

The HTTP method used to receive the SAML message.

Overrides
HttpRequestBase.HttpMethod

InputStream

Gets the input stream used to receive the SAML message.

Declaration
public override Stream InputStream { get; }
Property Value
Type Description
Stream

The input stream used to receive the SAML message.

Overrides
HttpRequestBase.InputStream

IsSecureConnection

Gets the flag indicating whether the connection is secure (ie HTTPS).

Declaration
public override bool IsSecureConnection { get; }
Property Value
Type Description
bool

The the flag indicating whether the connection is secure (ie HTTPS).

Overrides
HttpRequestBase.IsSecureConnection

Path

Gets the path used to receive the SAML message.

Declaration
public override string Path { get; }
Property Value
Type Description
string

The path used to receive the SAML message.

Overrides
HttpRequestBase.Path

QueryString

Gets the query string variables used to receive the SAML message.

Declaration
public override NameValueCollection QueryString { get; }
Property Value
Type Description
NameValueCollection

The query string variables used to receive the SAML message.

Overrides
HttpRequestBase.QueryString

RawUrl

Gets the raw URL used to receive the SAML message.

Declaration
public override string RawUrl { get; }
Property Value
Type Description
string

The raw URL used to receive the SAML message.

Overrides
HttpRequestBase.RawUrl

RequestType

Gets the request type (Get or Post) used to receive the SAML message.

Declaration
public override string RequestType { get; set; }
Property Value
Type Description
string

The request type used to receive the SAML message.

Overrides
HttpRequestBase.RequestType

ServerVariables

Gets the server variables used to receive the SAML message.

Declaration
public override NameValueCollection ServerVariables { get; }
Property Value
Type Description
NameValueCollection

The server variables used to receive the SAML message.

Overrides
HttpRequestBase.ServerVariables

Url

Gets the URL used to receive the SAML message.

Declaration
public override Uri Url { get; }
Property Value
Type Description
Uri

The URL used to receive the SAML message.

Overrides
HttpRequestBase.Url

Methods

Dispose()

Dispose of any unmanaged resources.

Declaration
public void Dispose()

Dispose(bool)

Dispose of any unmanaged resources.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing

true if called by user code; false if called by the runtime from within the finalizer

Implements

IDisposable
In this article
Back to top Copyright © ComponentSpace Pty Ltd 2004-2025. All rights reserved.