Class SamlProvider
Provides support for web browser single sign-on.
Inherited Members
Namespace: ComponentSpace.Saml2
Assembly: ComponentSpace.Saml2.dll
Syntax
public abstract class SamlProvider : ISamlProvider, IArtifactResolver
  Constructors
SamlProvider(IHttpContextAccessor, ISamlConfigurationNameResolver, ISamlConfigurationResolver, ICertificateManager, ICertificateLoader, IIDCache, ISsoSessionStore, IHttpPostBinding, IHttpRedirectBinding, IHttpArtifactBinding, IArtifactCache, ISoapBinding, IUrlUtility, ISamlSchemaValidator, IXmlSignature, IXmlEncryption, IOptionsMonitor<CookiePolicyOptions>, ILoggerFactory)
Initializes a new instance of the SamlProvider class.
Declaration
public SamlProvider(IHttpContextAccessor httpContextAccessor, ISamlConfigurationNameResolver samlConfigurationNameResolver, ISamlConfigurationResolver samlConfigurationResolver, ICertificateManager certificateManager, ICertificateLoader certificateLoader, IIDCache idCache, ISsoSessionStore ssoSessionStore, IHttpPostBinding httpPostBinding, IHttpRedirectBinding httpRedirectBinding, IHttpArtifactBinding httpArtifactBinding, IArtifactCache artifactCache, ISoapBinding soapBinding, IUrlUtility urlUtility, ISamlSchemaValidator samlSchemaValidator, IXmlSignature xmlSignature, IXmlEncryption xmlEncryption, IOptionsMonitor<CookiePolicyOptions> cookiePolicyOptions, ILoggerFactory loggerFactory)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IHttpContextAccessor | httpContextAccessor | The HTTP context accessor.  | 
      
| ISamlConfigurationNameResolver | samlConfigurationNameResolver | The SAML configuration name resolver.  | 
      
| ISamlConfigurationResolver | samlConfigurationResolver | The SAML configuration resolver.  | 
      
| ICertificateManager | certificateManager | The certificate manager.  | 
      
| ICertificateLoader | certificateLoader | The certificate loader.  | 
      
| IIDCache | idCache | The ID cache.  | 
      
| ISsoSessionStore | ssoSessionStore | The SSO session store.  | 
      
| IHttpPostBinding | httpPostBinding | The HTTP Post binding.  | 
      
| IHttpRedirectBinding | httpRedirectBinding | The HTTP Redirect binding.  | 
      
| IHttpArtifactBinding | httpArtifactBinding | The HTTP Artifact binding.  | 
      
| IArtifactCache | artifactCache | The HTTP Artifact cache.  | 
      
| ISoapBinding | soapBinding | The SOAP binding.  | 
      
| IUrlUtility | urlUtility | The URL utility.  | 
      
| ISamlSchemaValidator | samlSchemaValidator | The SAML XML schema validator.  | 
      
| IXmlSignature | xmlSignature | The XML signature provider.  | 
      
| IXmlEncryption | xmlEncryption | The XML encryption provider.  | 
      
| IOptionsMonitor<CookiePolicyOptions> | cookiePolicyOptions | The cookie policy options.  | 
      
| ILoggerFactory | loggerFactory | The logger factory.  | 
      
Methods
ClearSessionAsync(string)
Clears the current SAML session state for all partners or for the specified partner only.
Declaration
public abstract Task ClearSessionAsync(string partnerName = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | partnerName | The partner name or   | 
      
Returns
| Type | Description | 
|---|---|
| Task | A task that represents the operation.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| SamlException | Thrown when the SAML session state cannot be cleared.  | 
      
GetStatusAsync()
Returns the current SSO status.
Declaration
public abstract Task<ISsoStatus> GetStatusAsync()
  Returns
| Type | Description | 
|---|---|
| Task<ISsoStatus> | A task that represents the operation and returns the current SSO status.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| SamlException | Thrown when the starts cannot be retrieved.  | 
      
PeekMessageTypeAsync()
Peeks the currently received SAML message type.
Declaration
public Task<SamlMessageType> PeekMessageTypeAsync()
  Returns
| Type | Description | 
|---|---|
| Task<SamlMessageType> | The SAML message type.  | 
      
ResolveArtifactAsync()
Receives an artifact resolve request and sends an artifact response,.
Declaration
public abstract Task ResolveArtifactAsync()
  Returns
| Type | Description | 
|---|---|
| Task | A task that represents the operation.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| SamlException | Thrown when the artifact resolve request cannot be processed.  | 
      
SetConfigurationNameAsync(string)
Sets the SAML configuration name for the current SAML SSO session.
For most applications, a single SAML configuration is used and the SAML configuration name is not required. For multi-tenanted applications and other special use cases with multiple SAML configurations, the SAML name specifies the configuration to use.
Declaration
public Task SetConfigurationNameAsync(string configurationName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | configurationName | The configuration name.  | 
      
Returns
| Type | Description | 
|---|---|
| Task | A task that represents the operation.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| SamlException | Thrown when the configuration name cannot be set.  |