Share via


JwtSecurityTokenRequirement Class

Provides a location for settings that control how the JwtSecurityTokenHandler validates or creates a JwtSecurityToken.

Inheritance Hierarchy

System.Object
  System.IdentityModel.Tokens.JwtSecurityTokenRequirement

Namespace:  System.IdentityModel.Tokens
Assembly:  System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)

Syntax

'Declaration
Public Class JwtSecurityTokenRequirement
public class JwtSecurityTokenRequirement
public ref class JwtSecurityTokenRequirement
type JwtSecurityTokenRequirement =  class end
public class JwtSecurityTokenRequirement

The JwtSecurityTokenRequirement type exposes the following members.

Constructors

  Name Description
Public method JwtSecurityTokenRequirement() Creates an instance of JwtSecurityTokenRequirement
Public method JwtSecurityTokenRequirement(XmlElement) Provides additional configuration to the JwtSecurityTokenHandler when validating or creating a JwtSecurityToken.

Top

Properties

  Name Description
Public property CertificateValidator Gets or sets the X509CertificateValidator for validating X509Certificate2(s).
Public property DefaultTokenLifetimeInMinutes Gets or sets the default for token lifetime.JwtSecurityTokenHandler uses this value when creating a JwtSecurityToken if the expiration time is not specified. The expiration time will be set to UtcNow + FromMinutes with DefaultTokenLifetimeInMinutes as the parameter.
Public property MaxClockSkew Gets or sets the maximum clock skew to use when validating lifetime of a JwtSecurityToken.
Public property MaximumTokenSizeInBytes Gets or sets the maximum size of a JwtSecurityToken the JwtSecurityTokenHandler will read and validate.
Public property NameClaimType Gets or sets the String the JwtSecurityTokenHandler passes as a parameter to ClaimsIdentity.This defines the Type to match when finding the Value that is used for the Name property.
Public property RoleClaimType Gets or sets the String the JwtSecurityTokenHandler passes as a parameter to ClaimsIdentity.This defines the Claim(s) that will be considered when answering IsInRole

Top

Methods

  Name Description
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

These values have precedence over Configuration.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.IdentityModel.Tokens Namespace