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 |
---|---|---|
Microsoft.AspNetCore.Http.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. |
Microsoft.Extensions.Options.IOptionsMonitor<Microsoft.AspNetCore.Builder.CookiePolicyOptions> | cookiePolicyOptions | The cookie policy options. |
Microsoft.Extensions.Logging.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 |
---|---|---|
System.String | partnerName | The partner name or |
Returns
Type | Description |
---|---|
System.Threading.Tasks.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 |
---|---|
System.Threading.Tasks.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 async Task<SamlMessageType> PeekMessageTypeAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.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 |
---|---|
System.Threading.Tasks.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 async Task SetConfigurationNameAsync(string configurationName)
Parameters
Type | Name | Description |
---|---|---|
System.String | configurationName | The configuration name. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the operation. |
Exceptions
Type | Condition |
---|---|
SamlException | Thrown when the configuration name cannot be set. |