Show / Hide Table of Contents

Class SamlAuthenticationHandler

The SAML authentication handler.

Inheritance
object
AuthenticationHandler<SamlAuthenticationOptions>
SamlAuthenticationHandler
Implements
IAuthenticationRequestHandler
IAuthenticationSignOutHandler
IAuthenticationHandler
Inherited Members
AuthenticationHandler<SamlAuthenticationOptions>.InitializeAsync(AuthenticationScheme, HttpContext)
AuthenticationHandler<SamlAuthenticationOptions>.InitializeEventsAsync()
AuthenticationHandler<SamlAuthenticationOptions>.CreateEventsAsync()
AuthenticationHandler<SamlAuthenticationOptions>.InitializeHandlerAsync()
AuthenticationHandler<SamlAuthenticationOptions>.BuildRedirectUri(string)
AuthenticationHandler<SamlAuthenticationOptions>.ResolveTarget(string)
AuthenticationHandler<SamlAuthenticationOptions>.AuthenticateAsync()
AuthenticationHandler<SamlAuthenticationOptions>.HandleAuthenticateOnceAsync()
AuthenticationHandler<SamlAuthenticationOptions>.HandleAuthenticateOnceSafeAsync()
AuthenticationHandler<SamlAuthenticationOptions>.ChallengeAsync(AuthenticationProperties)
AuthenticationHandler<SamlAuthenticationOptions>.ForbidAsync(AuthenticationProperties)
AuthenticationHandler<SamlAuthenticationOptions>.Scheme
AuthenticationHandler<SamlAuthenticationOptions>.Options
AuthenticationHandler<SamlAuthenticationOptions>.Context
AuthenticationHandler<SamlAuthenticationOptions>.Request
AuthenticationHandler<SamlAuthenticationOptions>.Response
AuthenticationHandler<SamlAuthenticationOptions>.OriginalPath
AuthenticationHandler<SamlAuthenticationOptions>.OriginalPathBase
AuthenticationHandler<SamlAuthenticationOptions>.Logger
AuthenticationHandler<SamlAuthenticationOptions>.UrlEncoder
AuthenticationHandler<SamlAuthenticationOptions>.Clock
AuthenticationHandler<SamlAuthenticationOptions>.OptionsMonitor
AuthenticationHandler<SamlAuthenticationOptions>.Events
AuthenticationHandler<SamlAuthenticationOptions>.ClaimsIssuer
AuthenticationHandler<SamlAuthenticationOptions>.CurrentUri
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: ComponentSpace.Saml2.Authentication
Assembly: ComponentSpace.Saml2.dll
Syntax
public class SamlAuthenticationHandler : AuthenticationHandler<SamlAuthenticationOptions>, IAuthenticationRequestHandler, IAuthenticationSignOutHandler, IAuthenticationHandler

Constructors

SamlAuthenticationHandler(IOptionsMonitor<SamlAuthenticationOptions>, ILoggerFactory, UrlEncoder, ISystemClock, ISamlServiceProvider, ISsoSessionStore, ISamlClaimFactory, IUrlUtility)

Initializes a new instance of the SamlAuthenticationHandler class.

Declaration
public SamlAuthenticationHandler(IOptionsMonitor<SamlAuthenticationOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, ISamlServiceProvider samlServiceProvider, ISsoSessionStore ssoSessionStore, ISamlClaimFactory samlClaimFactory, IUrlUtility urlUtility)
Parameters
Type Name Description
IOptionsMonitor<SamlAuthenticationOptions> options

The SAML authentication options.

ILoggerFactory logger

The logger factory.

UrlEncoder encoder

The URL encoder.

ISystemClock clock

The system clock.

ISamlServiceProvider samlServiceProvider

The SAML service provider.

ISsoSessionStore ssoSessionStore

The SSO session store.

ISamlClaimFactory samlClaimFactory

The SAML claims factory.

IUrlUtility urlUtility

The URL utility.

Methods

HandleAuthenticateAsync()

Handles authentication.

Declaration
protected override Task<AuthenticateResult> HandleAuthenticateAsync()
Returns
Type Description
Task<AuthenticateResult>

A task that represents the operation.

Overrides
AuthenticationHandler<SamlAuthenticationOptions>.HandleAuthenticateAsync()

HandleChallengeAsync(AuthenticationProperties)

Handles challenge.

Declaration
protected override Task HandleChallengeAsync(AuthenticationProperties authenticationProperties)
Parameters
Type Name Description
AuthenticationProperties authenticationProperties

The authentication properties.

Returns
Type Description
Task

A task that represents the operation.

Overrides
AuthenticationHandler<SamlAuthenticationOptions>.HandleChallengeAsync(AuthenticationProperties)

HandleForbiddenAsync(AuthenticationProperties)

Handles forbidden.

Declaration
protected override Task HandleForbiddenAsync(AuthenticationProperties authenticationProperties)
Parameters
Type Name Description
AuthenticationProperties authenticationProperties

The authentication properties.

Returns
Type Description
Task

A task that represents the operation.

Overrides
AuthenticationHandler<SamlAuthenticationOptions>.HandleForbiddenAsync(AuthenticationProperties)

HandleRequestAsync()

Handles a request.

Declaration
public virtual Task<bool> HandleRequestAsync()
Returns
Type Description
Task<bool>

true if the request is handled; otherwise false.

SignOutAsync(AuthenticationProperties)

Signs out.

Declaration
public virtual Task SignOutAsync(AuthenticationProperties authenticationProperties)
Parameters
Type Name Description
AuthenticationProperties authenticationProperties

The authentication properties.

Returns
Type Description
Task

A task that represents the operation.

Implements

IAuthenticationRequestHandler
IAuthenticationSignOutHandler
IAuthenticationHandler
In this article
Back to top Copyright © ComponentSpace Pty Ltd 2017-2025. All rights reserved.