Condividi tramite


JwtPayload Class

Definition

Initializes a new instance of JwtPayload which contains JSON objects representing the claims contained in the JWT. Each claim is a JSON object of the form { Name, Value }.

public class JwtPayload : System.Collections.Generic.Dictionary<string,object>
type JwtPayload = class
    inherit Dictionary<string, obj>
Public Class JwtPayload
Inherits Dictionary(Of String, Object)
Inheritance
JwtPayload

Constructors

JwtPayload()

Initializes a new instance of the JwtPayload class with no claims. Default string comparer Ordinal. Creates a empty JwtPayload

JwtPayload(IEnumerable<Claim>)

Initializes a new instance of the JwtPayload class with IEnumerable<T>. Default string comparer Ordinal.

JwtPayload(String, IList<String>, IEnumerable<Claim>, IDictionary<String,Object>, Nullable<DateTime>, Nullable<DateTime>, Nullable<DateTime>)

Initializes a new instance of the JwtPayload class with claims added for each parameter specified. Default string comparer Ordinal.

JwtPayload(String, String, IEnumerable<Claim>, IDictionary<String,Object>, Nullable<DateTime>, Nullable<DateTime>, Nullable<DateTime>)

Initializes a new instance of the JwtPayload class with claims added for each parameter specified. Default string comparer Ordinal.

JwtPayload(String, String, IEnumerable<Claim>, Nullable<DateTime>, Nullable<DateTime>, Nullable<DateTime>)

Initializes a new instance of the JwtPayload class with claims added for each parameter specified. Default string comparer Ordinal.

JwtPayload(String, String, IEnumerable<Claim>, Nullable<DateTime>, Nullable<DateTime>)

Initializes a new instance of the JwtPayload class with claims added for each parameter specified. Default string comparer Ordinal.

JwtPayload(String, String, IList<String>, IEnumerable<Claim>, IDictionary<String,Object>, Nullable<DateTime>, Nullable<DateTime>, Nullable<DateTime>)

Initializes a new instance of the JwtPayload class with claims added for each parameter specified. Default string comparer Ordinal.

Properties

Acr

Gets the 'value' of the 'acr' claim { acr, 'value' }.

Actort

Gets the 'value' of the 'actor' claim { actort, 'value' }.

Amr

Gets the 'value' of the 'amr' claim { amr, 'value' } as list of strings.

Aud

Gets the 'value' of the 'audience' claim { aud, 'value' } as a list of strings.

AuthTime

Gets the 'value' of the 'auth_time' claim { auth_time, 'value' }.

Azp

Gets the 'value' of the 'azp' claim { azp, 'value' }.

CHash

Gets 'value' of the 'c_hash' claim { c_hash, 'value' }.

Claims

Gets a IEnumerable<T>Claim for each JSON { name, value }.

Exp
Obsolete.

Gets the 'value' of the 'expiration' claim { exp, 'value' }.

Expiration

Gets the 'value' of the 'expiration' claim { exp, 'value' }.

Iat
Obsolete.

Gets the 'value' of the 'Issued At' claim { iat, 'value' }.

Iss

Gets the 'value' of the 'issuer' claim { iss, 'value' }.

IssuedAt

Gets the 'value' of the 'issued at' claim { iat, 'value' } converted to a DateTime assuming 'value' is seconds since UnixEpoch (UTC 1970-01-01T0:0:0Z).

Jti

Gets the 'value' of the 'JWT ID' claim { jti, 'value' }.

Nbf
Obsolete.

Gets the 'value' of the 'expiration' claim { nbf, 'value' }.

Nonce

Gets the 'value' of the 'nonce' claim { nonce, 'value' }.

NotBefore

Gets the 'value' of the 'notebefore' claim { nbf, 'value' }.

Sub

Gets the 'value' of the 'subject' claim { sub, 'value' }.

ValidFrom

Gets the 'value' of the 'notbefore' claim { nbf, 'value' } converted to a DateTime assuming 'value' is seconds since UnixEpoch (UTC 1970-01-01T0:0:0Z).

ValidTo

Gets the 'value' of the 'expiration' claim { exp, 'value' } converted to a DateTime assuming 'value' is seconds since UnixEpoch (UTC 1970-01-01T0:0:0Z).

Methods

AddClaim(Claim)

Adds a JSON object representing the Claim to the JwtPayload

AddClaims(IEnumerable<Claim>)

Adds a number of Claim to the JwtPayload as JSON { name, value } pairs.

Base64UrlDeserialize(String)

Deserializes Base64UrlEncoded JSON into a JwtPayload.

Base64UrlEncode()

Encodes this instance as Base64UrlEncoded JSON.

Deserialize(String)

Deserialzes JSON into a JwtPayload instance.

SerializeToJson()

Serializes this instance to JSON.

Applies to