JwtSecurityTokenHandler 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.
A SecurityTokenHandler designed for creating and validating Json Web Tokens. See: https://datatracker.ietf.org/doc/html/rfc7519 and http://www.rfc-editor.org/info/rfc7515
public class JwtSecurityTokenHandler : Microsoft.IdentityModel.Tokens.SecurityTokenHandler
type JwtSecurityTokenHandler = class
inherit SecurityTokenHandler
Public Class JwtSecurityTokenHandler
Inherits SecurityTokenHandler
- Inheritance
Constructors
JwtSecurityTokenHandler() |
Initializes a new instance of the JwtSecurityTokenHandler class. |
Fields
DefaultInboundClaimFilter |
Default claim type filter list. |
DefaultInboundClaimTypeMap |
Default claim type mapping for inbound claims. |
DefaultMapInboundClaims |
Default value for the flag that determines whether or not the InboundClaimTypeMap is used. |
DefaultOutboundAlgorithmMap |
Default JwtHeader algorithm mapping |
DefaultOutboundClaimTypeMap |
Default claim type mapping for outbound claims. |
Properties
CanValidateToken |
Returns a value that indicates if this handler can validate a SecurityToken. |
CanWriteToken |
Gets the value that indicates if this instance can write a SecurityToken. |
InboundClaimFilter |
Gets or sets the ISet<T> used to filter claims when populating a ClaimsIdentity claims form a JwtSecurityToken. When a JwtSecurityToken is validated, claims with types found in this ISet<T> will not be added to the ClaimsIdentity. The default value is ClaimTypeMapping.InboundClaimFilter. |
InboundClaimTypeMap |
Gets or sets the InboundClaimTypeMap which is used when setting the Type for claims in the ClaimsPrincipal extracted when validating a JwtSecurityToken. The Type is set to the JSON claim 'name' after translating using this mapping. The default value is ClaimTypeMapping.InboundClaimTypeMap. |
JsonClaimTypeProperty |
Gets or sets the property name of Properties the will contain .Net type that was recognized when Claims serialized the value to JSON. See for more information. |
MapInboundClaims |
Gets or sets the MapInboundClaims property which is used when determining whether or not to map claim types that are extracted when validating a JwtSecurityToken. If this is set to true, the Type is set to the JSON claim 'name' after translating using this mapping. Otherwise, no mapping occurs. The default value is true. |
MaximumTokenSizeInBytes |
Gets and sets the maximum token size in bytes that will be processed. (Inherited from TokenHandler) |
OutboundAlgorithmMap |
Gets the outbound algorithm map that is passed to the JwtHeader constructor. |
OutboundClaimTypeMap |
Gets or sets the OutboundClaimTypeMap which is used when creating a JwtSecurityToken from Claim(s). The JSON claim 'name' value is set to Type after translating using this mapping. The default value is ClaimTypeMapping.OutboundClaimTypeMap |
SetDefaultTimesOnTokenCreation |
Gets or sets a bool that controls if token creation will set default 'exp', 'nbf' and 'iat' if not specified. (Inherited from TokenHandler) |
ShortClaimTypeProperty |
Gets or sets the property name of Properties the will contain the original JSON claim 'name' if a mapping occurred when the Claim(s) were created. See for more information. |
TokenLifetimeInMinutes |
Gets or sets the token lifetime in minutes. (Inherited from TokenHandler) |
TokenType |
Gets the type of the JwtSecurityToken. |