ISecurityContext

Namespace: ASPSecurityKit
Assembly: ASPSecurityKit.dll

Summary

Provides an interface to represent the security context for a request.

Remarks

Properties in the context are set at different stages of the security pipeline so the consumers must make sure that they don’t depend on these properties before their values are set.

Properties

AuthMethod

Summary

Gets or sets the method of authentication used for the current request (if authentication is already established).

Value

The method of authentication used for the current request (if authentication is already established).

Remarks

This property should get initialized during authentication step as soon as a supported scheme is detected.

AuthDetails

Summary

Gets or sets the details related to the authenticated identity token for the current request (if authentication is already established).

Value

The details related to the authenticated identity token for the current request (if authentication is already established).

Remarks

This property should get initialized once the authentication is established and user data is loaded.

RequestService

Summary

Gets or sets the request service for the current request.

Value

The request service for the current request.

Remarks

This property should get initialized as soon as the security pipeline begins execution.

Methods

GetAuthOrThrow()

Summary

Gets the value of AuthDetails if it’s not null; otherwise, throws an exception.

Returns

The value of AuthDetails if it’s not null.

Parameters

This method has no parameters.

Exceptions
Type Description
System.InvalidOperationException When AuthDetails is null.