Microsoft.IdentityModel.Tokens.TokenHandler
Defines properties shared across all security token handlers.
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).
Gets and sets the maximum token size in bytes that will be processed.
Gets or sets a bool that controls if token creation will set default 'exp', 'nbf' and 'iat' if not specified.
Gets or sets the token lifetime in minutes.
protected TokenHandler()
Converts a string into an instance of SecurityToken.
public virtual Task<TokenValidationResult> ValidateTokenAsync(string token, TokenValidationParameters validationParameters)
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.
public virtual Task<TokenValidationResult> ValidateTokenAsync(SecurityToken token, TokenValidationParameters validationParameters)
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.