AuthCookieHandler

Namespace: ASPSecurityKit.AuthProviders
Assembly: ASPSecurityKit.dll

Summary

Implements IAuthenticationSchemeHandler to authenticate using cookie.

Remarks

The cookie should have the name as defined by Cookie. The supported format for value is [idTokenType]:[idToken]:[authUrnHash]. The hash is computed using authUrn [idTokenType]:[idToken] as input and HMACSHA256 as the hash provider. This scheme is usually not enabled by default; you must do so using the appropriate mechanism provided in your platform-specific ASPSecurityKit library. To learn more about this scheme, visit https://ASPSecurityKit.net/docs/article/authentication-schemes/#auth-cookie

Constructors

#ctor(sessionProvider,securityContext,errorResource)

Summary

Initializes a new instance of the AuthCookieHandler class.

Parameters
Name Type Description
sessionProvider ASPSecurityKit.IAuthSessionProvider The session provider.
securityContext ASPSecurityKit.ISecurityContext The security context.
errorResource ASPSecurityKit.IErrorMessageResourceProvider The error resource.

Methods

Validate(requestService)

Summary

Evaluates the specified request against the auth scheme represented by this interface.

Returns

AuthSchemeValidationResult instance with Evaluated as true If the scheme was found in the request (along with either Auth as not null if evaluation succeeded or Error populated if it failed); otherwise, false.

Parameters
Name Type Description
requestService ASPSecurityKit.IRequestService The request service.
Exceptions
Type Description
System.ArgumentNullException When requestService is null.

ValidateAsync(requestService)

Summary

Evaluates the specified request against the auth scheme represented by this interface.

Returns

AuthSchemeValidationResult instance with Evaluated as true If the scheme was found in the request (along with either Auth as not null if evaluation succeeded or Error populated if it failed); otherwise, false.

Parameters
Name Type Description
requestService ASPSecurityKit.IRequestService The request service.
Exceptions
Type Description
System.ArgumentNullException When requestService is null.

ValidateAsync(requestService,cancellationToken)

Summary

Evaluates the specified request against the auth scheme represented by this interface.

Returns

AuthSchemeValidationResult instance with Evaluated as true If the scheme was found in the request (along with either Auth as not null if evaluation succeeded or Error populated if it failed); otherwise, false.

Parameters
Name Type Description
requestService ASPSecurityKit.IRequestService The request service.
cancellationToken System.Threading.CancellationToken The cancellation token.
Exceptions
Type Description
System.ArgumentNullException When requestService is null.