Class SAMLServiceProvider
Provides Service Provider (SP) support for web browser single sign-on.
Inheritance
Inherited Members
Namespace: ComponentSpace.SAML2
Assembly: ComponentSpace.Saml2.dll
Syntax
public static class SAMLServiceProvider
Methods
CanSLO()
Indicates whether the service provider can single logout to one or more identity providers.
To single logout, one or more identity providers must have successfully completed SSO and also support SLO.
Declaration
public static bool CanSLO()
Returns
Type | Description |
---|---|
System.Boolean |
|
CanSLO(String)
Indicates whether the service provider can single logout to an indentity provider.
To single logout, the indentity provider must have successfully completed SSO and also support SLO.
Declaration
public static bool CanSLO(string partnerIdP)
Parameters
Type | Name | Description |
---|---|---|
System.String | partnerIdP | The partner indentity provider name. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetPartnersPendingResponse()
Gets the names of the partner identity providers to which a sign-on or logout response is pending.
Declaration
public static string[] GetPartnersPendingResponse()
Returns
Type | Description |
---|---|
System.String[] | The names of the partner identity providers or |
InitiateSLO(HttpResponse, String, String)
Initiates single logout from the service provider to the identity provider (ie. SP-initiated SLO).
A logout request is sent to the identity provider.
Declaration
public static void InitiateSLO(HttpResponse httpResponse, string logoutReason, string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponse | httpResponse | The HTTP response. |
System.String | logoutReason | The logout reason or |
System.String | relayState | The relay state or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single logout fails. |
InitiateSLO(HttpResponse, String, String, String)
Initiates single logout from the service provider to the identity provider (ie. SP-initiated SLO).
An logout request is sent to the identity provider.
Declaration
public static void InitiateSLO(HttpResponse httpResponse, string logoutReason, string relayState, string partnerIdP)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponse | httpResponse | The HTTP response. |
System.String | logoutReason | The logout reason or |
System.String | relayState | The relay state or |
System.String | partnerIdP | The partner identity provider name or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single logout fails. |
InitiateSLO(HttpResponseBase, String, String)
Initiates single logout from the service provider to the identity provider (ie. SP-initiated SLO).
A logout request is sent to the identity provider.
Declaration
public static void InitiateSLO(HttpResponseBase httpResponse, string logoutReason, string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponseBase | httpResponse | The HTTP response. |
System.String | logoutReason | The logout reason or |
System.String | relayState | The relay state or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single logout fails. |
InitiateSLO(HttpResponseBase, String, String, String)
Initiates single logout from the service provider to the identity provider (ie. SP-initiated SLO).
An logout request is sent to the identity provider.
Declaration
public static void InitiateSLO(HttpResponseBase httpResponse, string logoutReason, string relayState, string partnerIdP)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponseBase | httpResponse | The HTTP response. |
System.String | logoutReason | The logout reason or |
System.String | relayState | The relay state or |
System.String | partnerIdP | The partner identity provider name or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single logout fails. |
InitiateSSO(HttpResponse)
Initiates single sign-on from the service provider to the identity provider (ie. SP-initiated SSO).
An authn request is sent to the identity provider.
Declaration
public static void InitiateSSO(HttpResponse httpResponse)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponse | httpResponse | The HTTP response. |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single sign-on fails. |
InitiateSSO(HttpResponse, String, String)
Initiates single sign-on from the service provider to the identity provider (ie. SP-initiated SSO).
An authn request is sent to the identity provider.
Declaration
public static void InitiateSSO(HttpResponse httpResponse, string relayState, string partnerIdP)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponse | httpResponse | The HTTP response. |
System.String | relayState | The relay state or |
System.String | partnerIdP | The partner identity provider name or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single sign-on fails. |
InitiateSSO(HttpResponse, String, String, SSOOptions)
Initiates single sign-on from the service provider to the identity provider (ie. SP-initiated SSO).
An authn request is sent to the identity provider.
Declaration
public static void InitiateSSO(HttpResponse httpResponse, string relayState, string partnerIdP, SSOOptions ssoOptions)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponse | httpResponse | The HTTP response. |
System.String | relayState | The relay state or |
System.String | partnerIdP | The partner identity provider name or |
SSOOptions | ssoOptions | The SSO options or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single sign-on fails. |
InitiateSSO(HttpResponse, String, String, SSOOptions, String, String)
Initiates single sign-on from the service provider to the identity provider (ie. SP-initiated SSO).
An authn request is sent to the identity provider.
Declaration
public static void InitiateSSO(HttpResponse httpResponse, string relayState, string partnerIdP, SSOOptions ssoOptions, string assertionConsumerServiceUrl, string singleSignOnServiceUrl)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponse | httpResponse | The HTTP response. |
System.String | relayState | The relay state or |
System.String | partnerIdP | The partner identity provider name or |
SSOOptions | ssoOptions | The SSO options or |
System.String | assertionConsumerServiceUrl | The assertion consumer service URL or |
System.String | singleSignOnServiceUrl | The single sign-on service URL or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single sign-on fails. |
InitiateSSO(HttpResponseBase)
Initiates single sign-on from the service provider to the identity provider (ie. SP-initiated SSO).
An authn request is sent to the identity provider.
Declaration
public static void InitiateSSO(HttpResponseBase httpResponse)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponseBase | httpResponse | The HTTP response. |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single sign-on fails. |
InitiateSSO(HttpResponseBase, String, String)
Initiates single sign-on from the service provider to the identity provider (ie. SP-initiated SSO).
An authn request is sent to the identity provider.
Declaration
public static void InitiateSSO(HttpResponseBase httpResponse, string relayState, string partnerIdP)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponseBase | httpResponse | The HTTP response. |
System.String | relayState | The relay state or |
System.String | partnerIdP | The partner identity provider name or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single sign-on fails. |
InitiateSSO(HttpResponseBase, String, String, SSOOptions)
Initiates single sign-on from the service provider to the identity provider (ie. SP-initiated SSO).
An authn request is sent to the identity provider.
Declaration
public static void InitiateSSO(HttpResponseBase httpResponse, string relayState, string partnerIdP, SSOOptions ssoOptions)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponseBase | httpResponse | The HTTP response. |
System.String | relayState | The relay state or |
System.String | partnerIdP | The partner identity provider name or |
SSOOptions | ssoOptions | The SSO options or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single sign-on fails. |
InitiateSSO(HttpResponseBase, String, String, SSOOptions, String, String)
Initiates single sign-on from the service provider to the identity provider (ie. SP-initiated SSO).
An authn request is sent to the identity provider.
Declaration
public static void InitiateSSO(HttpResponseBase httpResponse, string relayState, string partnerIdP, SSOOptions ssoOptions, string assertionConsumerServiceUrl, string singleSignOnServiceUrl)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponseBase | httpResponse | The HTTP response. |
System.String | relayState | The relay state or |
System.String | partnerIdP | The partner identity provider name or |
SSOOptions | ssoOptions | The SSO options or |
System.String | assertionConsumerServiceUrl | The assertion consumer service URL or |
System.String | singleSignOnServiceUrl | The single sign-on service URL or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single sign-on fails. |
IsSLOCompletionPending()
Indicates whether a single logout response to an identity provider is pending.
Single logout is pending if a logout request has been received from an identity provider and a logout response is pending or a logout request has been sent to an identity provider and a logout response is pending.
Declaration
public static bool IsSLOCompletionPending()
Returns
Type | Description |
---|---|
System.Boolean |
|
IsSLOCompletionPending(String)
Indicates whether a single logout response to an identity provider is pending.
Single logout is pending if a logout request has been received from an identity provider and a logout response is pending a logout request has been sent to an identity provider and a logout response is pending.
Declaration
public static bool IsSLOCompletionPending(string partnerIdP)
Parameters
Type | Name | Description |
---|---|---|
System.String | partnerIdP | The partner identity provider name. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsSSO()
Indicates whether the service provider is currently single signed-on to an identity provider.
Declaration
public static bool IsSSO()
Returns
Type | Description |
---|---|
System.Boolean |
|
IsSSO(String)
Indicates whether the service provider is currently single signed-on to an identity provider.
Declaration
public static bool IsSSO(string partnerIdP)
Parameters
Type | Name | Description |
---|---|---|
System.String | partnerIdP | The partner identity provider name. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsSSOCompletionPending()
Indicates whether single sign-on to an identity provider is pending.
Single sign-on is pending if an authn request has been sent to an identity provider and a SAML response is pending.
Declaration
public static bool IsSSOCompletionPending()
Returns
Type | Description |
---|---|
System.Boolean |
|
IsSSOCompletionPending(String)
Indicates whether single sign-on to an identity provider is pending.
Single sign-on is pending if an authn request has been sent to an identity provider and a SAML response is pending.
Declaration
public static bool IsSSOCompletionPending(string partnerIdP)
Parameters
Type | Name | Description |
---|---|---|
System.String | partnerIdP | The partner identity provider name. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ReceiveSLO(HttpRequest, out Boolean, out String, out String, out String)
Receives a single logout request (ie. IdP-initiated SLO) or single logout response (ie. SP-initiated SLO) from an identity provider.
Declaration
public static void ReceiveSLO(HttpRequest httpRequest, out bool isRequest, out string logoutReason, out string partnerIdP, out string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequest | httpRequest | The HTTP request. |
System.Boolean | isRequest |
|
System.String | logoutReason | The reason associated with the logout request or |
System.String | partnerIdP | The partner identity provider name. |
System.String | relayState | The relay state or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single logout fails. |
ReceiveSLO(HttpRequestBase, out Boolean, out String, out String, out String)
Receives a single logout request (ie. IdP-initiated SLO) or single logout response (ie. SP-initiated SLO) from an identity provider.
Declaration
public static void ReceiveSLO(HttpRequestBase httpRequest, out bool isRequest, out string logoutReason, out string partnerIdP, out string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequestBase | httpRequest | The HTTP request. |
System.Boolean | isRequest |
|
System.String | logoutReason | The reason associated with the logout request or |
System.String | partnerIdP | The partner identity provider name. |
System.String | relayState | The relay state or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single logout fails. |
ReceiveSSO(HttpRequest, out Boolean, out String, out String, out String, out SAMLAttribute[], out String)
Receives a single sign-on response from the identity provider (ie. IdP-initiated or SP-initiated SSO).
Declaration
public static void ReceiveSSO(HttpRequest httpRequest, out bool isInResponseTo, out string partnerIdP, out string authnContext, out string userName, out SAMLAttribute[] attributes, out string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequest | httpRequest | The HTTP request. |
System.Boolean | isInResponseTo |
|
System.String | partnerIdP | The partner identity provider name. |
System.String | authnContext | The authentication context identifying how the user was authenticated. |
System.String | userName | The user name in the SAML assertion. |
SAMLAttribute[] | attributes | The attributes in the SAML assertion or |
System.String | relayState | The relay state or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single sign-on fails. |
ReceiveSSO(HttpRequest, out Boolean, out String, out String, out String, out IDictionary<String, String>, out String)
Receives a single sign-on response from the identity provider (ie. IdP-initiated or SP-initiated SSO).
Declaration
public static void ReceiveSSO(HttpRequest httpRequest, out bool isInResponseTo, out string partnerIdP, out string authnContext, out string userName, out IDictionary<string, string> attributes, out string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequest | httpRequest | The HTTP request. |
System.Boolean | isInResponseTo |
|
System.String | partnerIdP | The partner identity provider name. |
System.String | authnContext | The authentication context identifying how the user was authenticated. |
System.String | userName | The user name in the SAML assertion. |
System.Collections.Generic.IDictionary<System.String, System.String> | attributes | The attributes in the SAML assertion or |
System.String | relayState | The relay state or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single sign-on fails. |
ReceiveSSO(HttpRequestBase, out Boolean, out String, out String, out String, out SAMLAttribute[], out String)
Receives a single sign-on response from the identity provider (ie. IdP-initiated or SP-initiated SSO).
Declaration
public static void ReceiveSSO(HttpRequestBase httpRequest, out bool isInResponseTo, out string partnerIdP, out string authnContext, out string userName, out SAMLAttribute[] attributes, out string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequestBase | httpRequest | The HTTP request. |
System.Boolean | isInResponseTo |
|
System.String | partnerIdP | The partner identity provider name. |
System.String | authnContext | The authentication context identifying how the user was authenticated. |
System.String | userName | The user name in the SAML assertion. |
SAMLAttribute[] | attributes | The attributes in the SAML assertion or |
System.String | relayState | The relay state or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single sign-on fails. |
ReceiveSSO(HttpRequestBase, out Boolean, out String, out String, out String, out IDictionary<String, String>, out String)
Receives a single sign-on response from the identity provider (ie. IdP-initiated or SP-initiated SSO).
Declaration
public static void ReceiveSSO(HttpRequestBase httpRequest, out bool isInResponseTo, out string partnerIdP, out string authnContext, out string userName, out IDictionary<string, string> attributes, out string relayState)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequestBase | httpRequest | The HTTP request. |
System.Boolean | isInResponseTo |
|
System.String | partnerIdP | The partner identity provider name. |
System.String | authnContext | The authentication context identifying how the user was authenticated. |
System.String | userName | The user name in the SAML assertion. |
System.Collections.Generic.IDictionary<System.String, System.String> | attributes | The attributes in the SAML assertion or |
System.String | relayState | The relay state or |
Exceptions
Type | Condition |
---|---|
SAMLException | Thrown when the single sign-on fails. |
SendSLO(HttpResponse, String)
Sends a single logout response to the identity provider (ie IdP-initiated SLO).
Declaration
public static void SendSLO(HttpResponse httpResponse, string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponse | httpResponse | The HTTP response. |
System.String | errorMessage | The error message or |
SendSLO(HttpResponseBase, String)
Sends a single logout response to the identity provider (ie IdP-initiated SLO).
Declaration
public static void SendSLO(HttpResponseBase httpResponse, string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpResponseBase | httpResponse | The HTTP response. |
System.String | errorMessage | The error message or |