JwtSecurityToken Class

A class that represents a JSON Web Token (JWT).

System::Object
  System.IdentityModel.Tokens::SecurityToken
    System.IdentityModel.Tokens::JwtSecurityToken

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

public ref class JwtSecurityToken : public SecurityToken

The JwtSecurityToken type exposes the following members.

  NameDescription
Public methodJwtSecurityToken(String)Constructs a JwtSecurityToken from a string in JSON Web Signature (JWS) Compact serialized format.
Public methodJwtSecurityToken(JwtHeader, JwtPayload, String)Constructs a JwtSecurityToken where the JwtHeader contains the crypto algorithms applied to the encoded JwtHeader and JwtPayload. The jwtEncodedString is the result of those operations.
Public methodJwtSecurityToken(String, String, IEnumerable<Claim>, Lifetime, SigningCredentials)Constructs a JwtSecurityToken specifying optional parameters.
Top

  NameDescription
Public propertyActorGets the 'value' of the actor claim from JSON in the form of { actor, 'value' }.
Public propertyAudienceGets the 'value' of the audience claim from JSON in the form of { aud, 'value' }.
Public propertyClaimsGets the Claim(s) for this token.
Public propertyEncodedHeaderGets the [Base64UrlEncoded] JwtHeader associated with this instance.
Public propertyEncodedPayloadGets the [Base64UrlEncoded] JwtPayload associated with this instance.
Public propertyEncodedSignatureGets the current signature over the JWT.
Public propertyExpirationGets the 'value' of the expiration claim from JSON in the form of { aud, 'exp' }.
Public propertyHeaderGets the JwtHeader associated with this instance.
Public propertyIdGets the 'value' of the JWT ID claim from JSON in the form of { jti, 'value' }. (Overrides SecurityToken::Id.)
Public propertyIssuedAtGets the 'value' of the Issued At claim from JSON in the form of { iat, 'value' }.
Public propertyIssuerGets the 'value' of the issuer claim from JSON in the form of { iss, 'value' }.
Public propertyPayloadGets the JwtPayload associated with this instance.
Public propertyRawDataGets the original raw data of this instance when it was created.
Public propertySecurityKeysGets a collection of SecurityKey objects for this instance. (Overrides SecurityToken::SecurityKeys.)
Public propertySignatureAlgorithmGets the signature algorithm associated with this instance.
Public propertySigningCredentialsGets the SigningCredentials associated with this instance.
Public propertySigningKeyGets or sets the SecurityKey that signed this instance.
Public propertySigningTokenGets or sets the SecurityToken that contains a SecurityKey that signed this instance.
Public propertySubjectGets ‘value’ of the subject claim from JSON in the form of { sub, 'value' }.
Public propertyValidFromGets 'value' of the notbefore claim from JSON in the form of { nbf, 'value' } converted to a DateTime object assuming 'value' is seconds since UnixEpoch (UTC 1970-01-01T0:0:0Z). (Overrides SecurityToken::ValidFrom.)
Public propertyValidToGets 'value' of the expiration claim from JSON in the form of { exp, 'value' } converted to a DateTime assuming 'value' is seconds since UnixEpoch (UTC 1970-01-01T0:0:0Z). (Overrides SecurityToken::ValidTo.)
Top

  NameDescription
Public methodCanCreateKeyIdentifierClause<T>Gets a value that indicates whether this security token is capable of creating the specified key identifier. (Inherited from SecurityToken.)
Public methodCreateKeyIdentifierClause<T>Creates the specified key identifier clause. (Inherited from SecurityToken.)
Public methodEqualsDetermines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodMatchesKeyIdentifierClauseReturns a value that indicates whether the key identifier for this instance can be resolved to the specified key identifier. (Inherited from SecurityToken.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodResolveKeyIdentifierClauseGets the key for the specified key identifier clause. (Inherited from SecurityToken.)
Public methodToStringDecodes the JwtHeader and JwtPayload. (Overrides Object::ToString().)
Top

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