CookieAuthenticationHandler Class

Definition

Implementation for the cookie-based authentication handler.

public ref class CookieAuthenticationHandler : Microsoft::AspNetCore::Authentication::AuthenticationHandler<Microsoft::AspNetCore::Authentication::Cookies::CookieAuthenticationOptions ^>, Microsoft::AspNetCore::Authentication::IAuthenticationSignInHandler
public ref class CookieAuthenticationHandler : Microsoft::AspNetCore::Authentication::SignInAuthenticationHandler<Microsoft::AspNetCore::Authentication::Cookies::CookieAuthenticationOptions ^>
public class CookieAuthenticationHandler : Microsoft.AspNetCore.Authentication.AuthenticationHandler<Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions>, Microsoft.AspNetCore.Authentication.IAuthenticationSignInHandler
public class CookieAuthenticationHandler : Microsoft.AspNetCore.Authentication.SignInAuthenticationHandler<Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions>
type CookieAuthenticationHandler = class
    inherit AuthenticationHandler<CookieAuthenticationOptions>
    interface IAuthenticationSignInHandler
    interface IAuthenticationSignOutHandler
    interface IAuthenticationHandler
type CookieAuthenticationHandler = class
    inherit SignInAuthenticationHandler<CookieAuthenticationOptions>
Public Class CookieAuthenticationHandler
Inherits AuthenticationHandler(Of CookieAuthenticationOptions)
Implements IAuthenticationSignInHandler
Public Class CookieAuthenticationHandler
Inherits SignInAuthenticationHandler(Of CookieAuthenticationOptions)
Inheritance
Inheritance
Implements

Constructors

CookieAuthenticationHandler(IOptionsMonitor<CookieAuthenticationOptions>, ILoggerFactory, UrlEncoder, ISystemClock)

Initializes a new instance of CookieAuthenticationHandler.

Properties

ChallengeCalled (Inherited from AuthenticationHandler<TOptions>)
ClaimsIssuer

Gets the issuer that should be used when any claims are issued.

(Inherited from AuthenticationHandler<TOptions>)
Clock

Gets the ISystemClock.

(Inherited from AuthenticationHandler<TOptions>)
Context

Gets or sets the HttpContext.

(Inherited from AuthenticationHandler<TOptions>)
CurrentUri

Gets the absolute current url.

(Inherited from AuthenticationHandler<TOptions>)
Events

The handler calls methods on the events which give the application control at certain points where processing is occurring. If it is not provided a default instance is supplied which does nothing when the methods are called.

InitializeResult (Inherited from AuthenticationHandler<TOptions>)
Logger

Gets the ILogger.

(Inherited from AuthenticationHandler<TOptions>)
Options

Gets or sets the options associated with this authentication handler.

(Inherited from AuthenticationHandler<TOptions>)
OptionsMonitor

Gets the IOptionsMonitor<TOptions> to detect changes to options.

(Inherited from AuthenticationHandler<TOptions>)
OriginalPath

Gets the path as seen by the authentication middleware.

(Inherited from AuthenticationHandler<TOptions>)
OriginalPathBase

Gets the path base as seen by the authentication middleware.

(Inherited from AuthenticationHandler<TOptions>)
PriorHandler (Inherited from AuthenticationHandler<TOptions>)
Request

Gets the HttpRequest associated with the current request.

(Inherited from AuthenticationHandler<TOptions>)
Response

Gets the HttpResponse associated with the current request.

(Inherited from AuthenticationHandler<TOptions>)
Scheme

Gets or sets the AuthenticationScheme asssociated with this authentication handler.

(Inherited from AuthenticationHandler<TOptions>)
SignInAccepted (Inherited from AuthenticationHandler<TOptions>)
SignOutAccepted (Inherited from AuthenticationHandler<TOptions>)
UrlEncoder

Gets the UrlEncoder.

(Inherited from AuthenticationHandler<TOptions>)

Methods

AuthenticateAsync()

Authenticate the current request.

(Inherited from AuthenticationHandler<TOptions>)
AuthenticateAsync(AuthenticateContext) (Inherited from AuthenticationHandler<TOptions>)
BuildRedirectUri(String)

Constructs an absolute url for the specified targetPath.

(Inherited from AuthenticationHandler<TOptions>)
ChallengeAsync(AuthenticationProperties)

Challenge the current request.

(Inherited from AuthenticationHandler<TOptions>)
ChallengeAsync(ChallengeContext) (Inherited from AuthenticationHandler<TOptions>)
CreateEventsAsync()

Creates a new instance of the events instance.

FinishResponseAsync()

Hook that is called when the response about to be sent

ForbidAsync(AuthenticationProperties)

Forbid the current request.

(Inherited from AuthenticationHandler<TOptions>)
GetDescriptions(DescribeSchemesContext) (Inherited from AuthenticationHandler<TOptions>)
HandleAuthenticateAsync()

Allows derived types to handle authentication.

HandleAuthenticateOnceAsync()

Used to ensure HandleAuthenticateAsync is only invoked once. The subsequent calls will return the same authenticate result.

(Inherited from AuthenticationHandler<TOptions>)
HandleAuthenticateOnceSafeAsync()

Used to ensure HandleAuthenticateAsync is only invoked once safely. The subsequent calls will return the same authentication result. Any exceptions will be converted into a failed authentication result containing the exception.

(Inherited from AuthenticationHandler<TOptions>)
HandleChallengeAsync(AuthenticationProperties)

Override this method to deal with 401 challenge concerns, if an authentication scheme in question deals an authentication interaction as part of it's request flow. (like adding a response header, or changing the 401 result to 302 of a login page or external sign-in location.)

HandleForbiddenAsync(AuthenticationProperties)

Override this method to handle Forbid.

HandleForbiddenAsync(ChallengeContext)

Override this method to deal with a challenge that is forbidden.

(Inherited from AuthenticationHandler<TOptions>)
HandleRequestAsync()

Called once by common code after initialization. If an authentication middleware responds directly to specifically known paths it must override this virtual, compare the request path to it's known paths, provide any response information as appropriate, and true to stop further processing.

(Inherited from AuthenticationHandler<TOptions>)
HandleSignInAsync(ClaimsPrincipal, AuthenticationProperties)

Override this method to handle SignIn.

HandleSignInAsync(SignInContext) (Inherited from AuthenticationHandler<TOptions>)
HandleSignOutAsync(AuthenticationProperties)

Override this method to handle SignOut.

HandleSignOutAsync(SignOutContext) (Inherited from AuthenticationHandler<TOptions>)
HandleUnauthorizedAsync(ChallengeContext)

Override this method to deal with 401 challenge concerns, if an authentication scheme in question deals an authentication interaction as part of it's request flow. (like adding a response header, or changing the 401 result to 302 of a login page or external sign-in location.)

(Inherited from AuthenticationHandler<TOptions>)
InitializeAsync(AuthenticationScheme, HttpContext)

Initialize the handler, resolve the options and validate them.

(Inherited from AuthenticationHandler<TOptions>)
InitializeAsync(TOptions, HttpContext, ILogger, UrlEncoder)

Initialize is called once per request to contextualize this instance with appropriate state.

(Inherited from AuthenticationHandler<TOptions>)
InitializeEventsAsync()

Initializes the events object, called once per request by InitializeAsync(AuthenticationScheme, HttpContext).

(Inherited from AuthenticationHandler<TOptions>)
InitializeHandlerAsync()

Called after options/events have been initialized for the handler to finish initializing itself.

ResolveTarget(String)

Resolves the scheme that this authentication operation is forwarded to.

(Inherited from AuthenticationHandler<TOptions>)
ShouldHandleScheme(String, Boolean) (Inherited from AuthenticationHandler<TOptions>)
SignInAsync(ClaimsPrincipal, AuthenticationProperties)
SignInAsync(ClaimsPrincipal, AuthenticationProperties)

Handle sign in.

(Inherited from SignInAuthenticationHandler<TOptions>)
SignInAsync(SignInContext) (Inherited from AuthenticationHandler<TOptions>)
SignOutAsync(AuthenticationProperties)
SignOutAsync(AuthenticationProperties)

Signout behavior.

(Inherited from SignOutAuthenticationHandler<TOptions>)
SignOutAsync(SignOutContext) (Inherited from AuthenticationHandler<TOptions>)

Applies to