次の方法で共有


TokenHandler Class

Definition

Defines properties shared across all security token handlers.

public abstract class TokenHandler
type TokenHandler = class
Public MustInherit Class TokenHandler
Inheritance
TokenHandler
Derived

Constructors

TokenHandler()

Fields

DefaultTokenLifetimeInMinutes

Default lifetime of tokens created. When creating tokens, if 'expires', 'notbefore' or 'issuedat' are null, then a default will be set to: issuedat = DateTime.UtcNow, notbefore = DateTime.UtcNow, expires = DateTime.UtcNow + TimeSpan.FromMinutes(TokenLifetimeInMinutes).

Properties

MaximumTokenSizeInBytes

Gets and sets the maximum token size in bytes that will be processed.

SetDefaultTimesOnTokenCreation

Gets or sets a bool that controls if token creation will set default 'exp', 'nbf' and 'iat' if not specified.

TokenLifetimeInMinutes

Gets or sets the token lifetime in minutes.

Methods

ReadToken(String)

Converts a string into an instance of SecurityToken.

ValidateTokenAsync(SecurityToken, TokenValidationParameters)

Validates a token. On a validation failure, no exception will be thrown; instead, the exception will be set in the returned TokenValidationResult.Exception property. Callers should always check the TokenValidationResult.IsValid property to verify the validity of the result.

ValidateTokenAsync(String, TokenValidationParameters)

Validates a token. On a validation failure, no exception will be thrown; instead, the exception will be set in the returned TokenValidationResult.Exception property. Callers should always check the TokenValidationResult.IsValid property to verify the validity of the result.

Applies to