Class SamlProvider
- Namespace
- ComponentSpace.Saml2
- Assembly
- ComponentSpace.Saml2.dll
Provides support for web browser single sign-on.
public abstract class SamlProvider : ISamlProvider, IArtifactResolver
- Inheritance
-
SamlProvider
- Implements
- Derived
- Inherited Members
Constructors
SamlProvider(IHttpContextAccessor, ISamlConfigurationNameResolver, ISamlConfigurationResolver, ICertificateManager, ICertificateLoader, IIDCache, ISsoSessionStore, IHttpPostBinding, IHttpRedirectBinding, IHttpArtifactBinding, IArtifactCache, ISoapBinding, IUrlUtility, ISamlSchemaValidator, IXmlSignature, IXmlEncryption, IOptionsMonitor<CookiePolicyOptions>, LicenseManager, ILoggerFactory)
Initializes a new instance of the SamlProvider class.
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, LicenseManager licenseManager, ILoggerFactory loggerFactory)
Parameters
httpContextAccessorIHttpContextAccessorThe HTTP context accessor.
samlConfigurationNameResolverISamlConfigurationNameResolverThe SAML configuration name resolver.
samlConfigurationResolverISamlConfigurationResolverThe SAML configuration resolver.
certificateManagerICertificateManagerThe certificate manager.
certificateLoaderICertificateLoaderThe certificate loader.
idCacheIIDCacheThe ID cache.
ssoSessionStoreISsoSessionStoreThe SSO session store.
httpPostBindingIHttpPostBindingThe HTTP Post binding.
httpRedirectBindingIHttpRedirectBindingThe HTTP Redirect binding.
httpArtifactBindingIHttpArtifactBindingThe HTTP Artifact binding.
artifactCacheIArtifactCacheThe HTTP Artifact cache.
soapBindingISoapBindingThe SOAP binding.
urlUtilityIUrlUtilityThe URL utility.
samlSchemaValidatorISamlSchemaValidatorThe SAML XML schema validator.
xmlSignatureIXmlSignatureThe XML signature provider.
xmlEncryptionIXmlEncryptionThe XML encryption provider.
cookiePolicyOptionsIOptionsMonitor<CookiePolicyOptions>The cookie policy options.
licenseManagerLicenseManagerThe license manager.
loggerFactoryILoggerFactoryThe logger factory.
Methods
ClearSessionAsync(string)
Clears the current SAML session state for all partners or for the specified partner only.
public abstract Task ClearSessionAsync(string partnerName = null)
Parameters
partnerNamestringThe partner name or
nullif none.
Returns
- Task
A task that represents the operation.
Exceptions
- SamlException
Thrown when the SAML session state cannot be cleared.
GetStatusAsync()
Returns the current SSO status.
public abstract Task<ISsoStatus> GetStatusAsync()
Returns
- Task<ISsoStatus>
A task that represents the operation and returns the current SSO status.
Exceptions
- SamlException
Thrown when the starts cannot be retrieved.
PeekMessageTypeAsync()
Peeks the currently received SAML message type.
public Task<SamlMessageType> PeekMessageTypeAsync()
Returns
- Task<SamlMessageType>
The SAML message type.
ResolveArtifactAsync()
Receives an artifact resolve request and sends an artifact response,.
public abstract Task ResolveArtifactAsync()
Returns
- Task
A task that represents the operation.
Exceptions
- 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.
public Task SetConfigurationNameAsync(string configurationName)
Parameters
configurationNamestringThe configuration name.
Returns
- Task
A task that represents the operation.
Exceptions
- SamlException
Thrown when the configuration name cannot be set.