TokenHandler Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈