JwtPayload Class
The JwtPayload class contains JSON objects representing the claims contained in the JWT. Each claim is a JSON object in the form of { Name, Value }.
Inheritance Hierarchy
System.Object
System.Collections.Generic.Dictionary<String, Object>
System.IdentityModel.Tokens.JwtPayload
Namespace: System.IdentityModel.Tokens
Assembly: System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)
Syntax
'Declaration
Public Class JwtPayload _
Inherits Dictionary(Of String, Object)
public class JwtPayload : Dictionary<string, Object>
public ref class JwtPayload : public Dictionary<String^, Object^>
type JwtPayload =
class
inherit Dictionary<string, Object>
end
public class JwtPayload extends Dictionary<String, Object>
The JwtPayload type exposes the following members.
Constructors
Name | Description | |
---|---|---|
JwtPayload() | Creates an empty JwtPayload object. | |
JwtPayload(String, String, IEnumerable<Claim>, Lifetime) | Creates a JwtPayload object with claims added for each of the specified parameters. |
Top
Properties
Name | Description | |
---|---|---|
Actor | Gets the ‘value’ of the actor claim from JSON in the form of { actor, 'value' }. | |
Audience | Gets the ‘value’ of the audience claim from JSON in the form of { aud, 'value' }. | |
Claims | Gets a IEnumerable<T> containing aClaim object for each JSON name value pair, in the form of { name, value }. | |
Comparer | Gets the IEqualityComparer<T> that is used to determine equality of keys for the dictionary. (Inherited from Dictionary<String, Object>.) | |
Count | Gets the number of key/value pairs contained in the Dictionary<TKey, TValue>. (Inherited from Dictionary<String, Object>.) | |
Expiration | Gets the ‘value’ of the expiration claim from JSON in the form of { exp, 'value' }. | |
Id | Gets the 'value' of the JWT ID claim from JSON in the form of { jti, 'value' }. | |
IssuedAt | Gets the 'value' of the Issued At claim from JSON in the form of { iat, 'value' }. | |
Issuer | Gets 'value' of the issuer claim from JSON in the form of { iss, 'value' }. | |
Item | Gets or sets the value associated with the specified key. (Inherited from Dictionary<String, Object>.) | |
Keys | Gets a collection containing the keys in the Dictionary<TKey, TValue>. (Inherited from Dictionary<String, Object>.) | |
Subject | Gets ‘value’ of the subject claim from JSON in the form of { sub, 'value' }. | |
ValidFrom | Gets 'value' of the notbefore claim from JSON in the form of { nbf, 'value' }, which is converted to a DateTime object assuming 'value' is seconds since UnixEpoch (UTC 1970-01-01T0:0:0Z). | |
ValidTo | Gets 'value' of the expiration claim from JSON in the form of { exp, 'value' }, which is converted to a DateTime object assuming 'value' is seconds since UnixEpoch (UTC 1970-01-01T0:0:0Z). | |
Values | Gets a collection containing the values in the Dictionary<TKey, TValue>. (Inherited from Dictionary<String, Object>.) |
Top
Methods
Name | Description | |
---|---|---|
Add | Adds the specified key and value to the dictionary. (Inherited from Dictionary<String, Object>.) | |
AddClaim | Adds a JSON object representing the Claim to the JwtPayload. | |
AddClaims | Adds a number of Claim objects to the JwtPayload as JSON in the form of { name, value } pairs. | |
Clear | Removes all keys and values from the Dictionary<TKey, TValue>. (Inherited from Dictionary<String, Object>.) | |
ContainsKey | Determines whether the Dictionary<TKey, TValue> contains the specified key. (Inherited from Dictionary<String, Object>.) | |
ContainsValue | Determines whether the Dictionary<TKey, TValue> contains a specific value. (Inherited from Dictionary<String, Object>.) | |
Encode | Encodes this instance as a [Base64UrlEncoded] string. | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetEnumerator | Returns an enumerator that iterates through the Dictionary<TKey, TValue>. (Inherited from Dictionary<String, Object>.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetObjectData | Security Critical. Implements the System.Runtime.Serialization.ISerializable interface and returns the data needed to serialize the Dictionary<TKey, TValue> instance. (Inherited from Dictionary<String, Object>.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnDeserialization | Implements the System.Runtime.Serialization.ISerializable interface and raises the deserialization event when the deserialization is complete. (Inherited from Dictionary<String, Object>.) | |
Remove | Removes the value with the specified key from the Dictionary<TKey, TValue>. (Inherited from Dictionary<String, Object>.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
TryGetValue | Gets the value associated with the specified key. (Inherited from Dictionary<String, Object>.) |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
ICollection<KeyValuePair<TKey, TValue>>.Add | Adds the specified value to the ICollection<T> with the specified key. (Inherited from Dictionary<String, Object>.) | |
IDictionary.Add | Adds the specified key and value to the dictionary. (Inherited from Dictionary<String, Object>.) | |
ICollection<KeyValuePair<TKey, TValue>>.Contains | Determines whether the ICollection<T> contains a specific key and value. (Inherited from Dictionary<String, Object>.) | |
IDictionary.Contains | Determines whether the IDictionary contains an element with the specified key. (Inherited from Dictionary<String, Object>.) | |
ICollection<KeyValuePair<TKey, TValue>>.CopyTo | Copies the elements of the ICollection<T> to an array of type KeyValuePair<TKey, TValue>, starting at the specified array index. (Inherited from Dictionary<String, Object>.) | |
ICollection.CopyTo | Copies the elements of the ICollection<T> to an array, starting at the specified array index. (Inherited from Dictionary<String, Object>.) | |
IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator | Returns an enumerator that iterates through the collection. (Inherited from Dictionary<String, Object>.) | |
IEnumerable.GetEnumerator | Returns an enumerator that iterates through the collection. (Inherited from Dictionary<String, Object>.) | |
IDictionary.GetEnumerator | Returns an IDictionaryEnumerator for the IDictionary. (Inherited from Dictionary<String, Object>.) | |
IDictionary.IsFixedSize | Gets a value indicating whether the IDictionary has a fixed size. (Inherited from Dictionary<String, Object>.) | |
ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly | Gets a value indicating whether the dictionary is read-only. (Inherited from Dictionary<String, Object>.) | |
IDictionary.IsReadOnly | Gets a value indicating whether the IDictionary is read-only. (Inherited from Dictionary<String, Object>.) | |
ICollection.IsSynchronized | Gets a value indicating whether access to the ICollection is synchronized (thread safe). (Inherited from Dictionary<String, Object>.) | |
IDictionary.Item | Gets or sets the value with the specified key. (Inherited from Dictionary<String, Object>.) | |
IDictionary<TKey, TValue>.Keys | Gets an ICollection<T> containing the keys of the IDictionary<TKey, TValue>. (Inherited from Dictionary<String, Object>.) | |
IReadOnlyDictionary<TKey, TValue>.Keys | Gets a collection containing the keys of the IReadOnlyDictionary<TKey, TValue>. (Inherited from Dictionary<String, Object>.) | |
IDictionary.Keys | Gets an ICollection containing the keys of the IDictionary. (Inherited from Dictionary<String, Object>.) | |
ICollection<KeyValuePair<TKey, TValue>>.Remove | Removes a key and value from the dictionary. (Inherited from Dictionary<String, Object>.) | |
IDictionary.Remove | Removes the element with the specified key from the IDictionary. (Inherited from Dictionary<String, Object>.) | |
ICollection.SyncRoot | Gets an object that can be used to synchronize access to the ICollection. (Inherited from Dictionary<String, Object>.) | |
IDictionary<TKey, TValue>.Values | Gets an ICollection<T> containing the values in the IDictionary<TKey, TValue>. (Inherited from Dictionary<String, Object>.) | |
IReadOnlyDictionary<TKey, TValue>.Values | Gets a collection containing the values of the IReadOnlyDictionary<TKey, TValue>. (Inherited from Dictionary<String, Object>.) | |
IDictionary.Values | Gets an ICollection containing the values in the IDictionary. (Inherited from Dictionary<String, Object>.) |
Top
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.