Compartilhar via


JwtPayload Constructors

Definition

Overloads

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, 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, 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, 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, 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()

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

public JwtPayload ();
Public Sub New ()

Applies to

JwtPayload(IEnumerable<Claim>)

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

public JwtPayload (System.Collections.Generic.IEnumerable<System.Security.Claims.Claim> claims);
new System.IdentityModel.Tokens.Jwt.JwtPayload : seq<System.Security.Claims.Claim> -> System.IdentityModel.Tokens.Jwt.JwtPayload
Public Sub New (claims As IEnumerable(Of Claim))

Parameters

claims
IEnumerable<Claim>

Applies to

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.

public JwtPayload (string issuer, string audience, System.Collections.Generic.IEnumerable<System.Security.Claims.Claim> claims, DateTime? notBefore, DateTime? expires);
new System.IdentityModel.Tokens.Jwt.JwtPayload : string * string * seq<System.Security.Claims.Claim> * Nullable<DateTime> * Nullable<DateTime> -> System.IdentityModel.Tokens.Jwt.JwtPayload
Public Sub New (issuer As String, audience As String, claims As IEnumerable(Of Claim), notBefore As Nullable(Of DateTime), expires As Nullable(Of DateTime))

Parameters

issuer
String

If this value is not null, a { iss, 'issuer' } claim will be added, overwriting any 'iss' claim in 'claims' if present.

audience
String

If this value is not null, a { aud, 'audience' } claim will be added, appending to any 'aud' claims in 'claims' if present.

claims
IEnumerable<Claim>

If this value is not null then for each Claim a { 'Claim.Type', 'Claim.Value' } is added. If duplicate claims are found then a { 'Claim.Type', List<object> } will be created to contain the duplicate values.

notBefore
Nullable<DateTime>

If notbefore.HasValue a { nbf, 'value' } claim is added, overwriting any 'nbf' claim in 'claims' if present.

expires
Nullable<DateTime>

If expires.HasValue a { exp, 'value' } claim is added, overwriting any 'exp' claim in 'claims' if present.

Applies to

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.

public JwtPayload (string issuer, string audience, System.Collections.Generic.IEnumerable<System.Security.Claims.Claim> claims, DateTime? notBefore, DateTime? expires, DateTime? issuedAt);
new System.IdentityModel.Tokens.Jwt.JwtPayload : string * string * seq<System.Security.Claims.Claim> * Nullable<DateTime> * Nullable<DateTime> * Nullable<DateTime> -> System.IdentityModel.Tokens.Jwt.JwtPayload
Public Sub New (issuer As String, audience As String, claims As IEnumerable(Of Claim), notBefore As Nullable(Of DateTime), expires As Nullable(Of DateTime), issuedAt As Nullable(Of DateTime))

Parameters

issuer
String

If this value is not null, a { iss, 'issuer' } claim will be added, overwriting any 'iss' claim in 'claims' if present.

audience
String

If this value is not null, a { aud, 'audience' } claim will be added, appending to any 'aud' claims in 'claims' if present.

claims
IEnumerable<Claim>

If this value is not null then for each Claim a { 'Claim.Type', 'Claim.Value' } is added. If duplicate claims are found then a { 'Claim.Type', List<object> } will be created to contain the duplicate values.

notBefore
Nullable<DateTime>

If notbefore.HasValue a { nbf, 'value' } claim is added, overwriting any 'nbf' claim in 'claims' if present.

expires
Nullable<DateTime>

If expires.HasValue a { exp, 'value' } claim is added, overwriting any 'exp' claim in 'claims' if present.

issuedAt
Nullable<DateTime>

If issuedAt.HasValue is 'true' a { iat, 'value' } claim is added, overwriting any 'iat' claim in 'claims' if present.

Exceptions

If 'expires' <= 'notbefore'.

Remarks

Comparison is set to Ordinal

The 4 parameters: 'issuer', 'audience', 'notBefore', 'expires' take precedence over Claim(s) in 'claims'. The values will be overridden.

Applies to

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.

public JwtPayload (string issuer, System.Collections.Generic.IList<string> audiences, System.Collections.Generic.IEnumerable<System.Security.Claims.Claim> claims, System.Collections.Generic.IDictionary<string,object> claimsCollection, DateTime? notBefore, DateTime? expires, DateTime? issuedAt);
new System.IdentityModel.Tokens.Jwt.JwtPayload : string * System.Collections.Generic.IList<string> * seq<System.Security.Claims.Claim> * System.Collections.Generic.IDictionary<string, obj> * Nullable<DateTime> * Nullable<DateTime> * Nullable<DateTime> -> System.IdentityModel.Tokens.Jwt.JwtPayload
Public Sub New (issuer As String, audiences As IList(Of String), claims As IEnumerable(Of Claim), claimsCollection As IDictionary(Of String, Object), notBefore As Nullable(Of DateTime), expires As Nullable(Of DateTime), issuedAt As Nullable(Of DateTime))

Parameters

issuer
String

If this value is not null, an { iss, 'issuer' } claim will be added, overwriting any 'iss' claim in 'claims' and 'claimCollection' if present.

audiences
IList<String>

If this value is not null, all non-null non-whitespace strings in it will be added to an { aud, 'audience' }, appending to any 'aud' claims in 'claims' or 'claimCollection' if present.

claims
IEnumerable<Claim>

If this value is not null then for each Claim a { 'Claim.Type', 'Claim.Value' } is added. If duplicate claims are found then a { 'Claim.Type', List<object> } will be created to contain the duplicate values.

claimsCollection
IDictionary<String,Object>

If both claims and claimsCollection are not null then the values in claims will be combined with the values in claimsCollection. The values found in claimCollection take precedence over those found in claims, so any duplicate values will be overridden.

notBefore
Nullable<DateTime>

If notbefore.HasValue an { nbf, 'value' } claim is added, overwriting any 'nbf' claim in 'claims' and 'claimcollection' if present.

expires
Nullable<DateTime>

If expires.HasValue an { exp, 'value' } claim is added, overwriting any 'exp' claim in 'claims' and 'claimcollection' if present.

issuedAt
Nullable<DateTime>

If issuedAt.HasValue is 'true' an { iat, 'value' } claim is added, overwriting any 'iat' claim in 'claims' and 'claimcollection' if present.

Exceptions

If 'expires' <= 'notbefore'.

Remarks

Comparison is set to Ordinal

The 4 parameters: 'issuer', 'audience', 'notBefore', 'expires' take precedence over Claim(s) in 'claims' and 'claimcollection'. The values will be overridden.

Applies to

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.

public JwtPayload (string issuer, string audience, System.Collections.Generic.IEnumerable<System.Security.Claims.Claim> claims, System.Collections.Generic.IDictionary<string,object> claimsCollection, DateTime? notBefore, DateTime? expires, DateTime? issuedAt);
new System.IdentityModel.Tokens.Jwt.JwtPayload : string * string * seq<System.Security.Claims.Claim> * System.Collections.Generic.IDictionary<string, obj> * Nullable<DateTime> * Nullable<DateTime> * Nullable<DateTime> -> System.IdentityModel.Tokens.Jwt.JwtPayload
Public Sub New (issuer As String, audience As String, claims As IEnumerable(Of Claim), claimsCollection As IDictionary(Of String, Object), notBefore As Nullable(Of DateTime), expires As Nullable(Of DateTime), issuedAt As Nullable(Of DateTime))

Parameters

issuer
String

If this value is not null, an { iss, 'issuer' } claim will be added, overwriting any 'iss' claim in 'claims' and 'claimCollection' if present.

audience
String

If this value is not null, an { aud, 'audience' } claim will be added, appending to any 'aud' claims in 'claims' or 'claimCollection' if present.

claims
IEnumerable<Claim>

If this value is not null then for each Claim a { 'Claim.Type', 'Claim.Value' } is added. If duplicate claims are found then a { 'Claim.Type', List<object> } will be created to contain the duplicate values.

claimsCollection
IDictionary<String,Object>

If both claims and claimsCollection are not null then the values in claims will be combined with the values in claimsCollection. The values found in claimCollection take precedence over those found in claims, so any duplicate values will be overridden.

notBefore
Nullable<DateTime>

If notbefore.HasValue an { nbf, 'value' } claim is added, overwriting any 'nbf' claim in 'claims' and 'claimcollection' if present.

expires
Nullable<DateTime>

If expires.HasValue an { exp, 'value' } claim is added, overwriting any 'exp' claim in 'claims' and 'claimcollection' if present.

issuedAt
Nullable<DateTime>

If issuedAt.HasValue is 'true' an { iat, 'value' } claim is added, overwriting any 'iat' claim in 'claims' and 'claimcollection' if present.

Exceptions

If 'expires' <= 'notbefore'.

Remarks

Comparison is set to Ordinal

The 4 parameters: 'issuer', 'audience', 'notBefore', 'expires' take precedence over Claim(s) in 'claims' and 'claimcollection'. The values will be overridden.

Applies to

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.

public JwtPayload (string issuer, string audience, System.Collections.Generic.IList<string> audiences, System.Collections.Generic.IEnumerable<System.Security.Claims.Claim> claims, System.Collections.Generic.IDictionary<string,object> claimsCollection, DateTime? notBefore, DateTime? expires, DateTime? issuedAt);
new System.IdentityModel.Tokens.Jwt.JwtPayload : string * string * System.Collections.Generic.IList<string> * seq<System.Security.Claims.Claim> * System.Collections.Generic.IDictionary<string, obj> * Nullable<DateTime> * Nullable<DateTime> * Nullable<DateTime> -> System.IdentityModel.Tokens.Jwt.JwtPayload
Public Sub New (issuer As String, audience As String, audiences As IList(Of String), claims As IEnumerable(Of Claim), claimsCollection As IDictionary(Of String, Object), notBefore As Nullable(Of DateTime), expires As Nullable(Of DateTime), issuedAt As Nullable(Of DateTime))

Parameters

issuer
String

If this value is not null, an { iss, 'issuer' } claim will be added, overwriting any 'iss' claim in 'claims' and 'claimCollection' if present.

audience
String

If this value is not null, an { aud, 'audience' } claim will be added, appending to any 'aud' claims in 'claims' or 'claimCollection' if present.

audiences
IList<String>

If this value is not null, all non-null non-whitespace strings in it will be added to an { aud, 'audience' }, appending to any 'aud' claims in 'claims' or 'claimCollection' if present.

claims
IEnumerable<Claim>

If this value is not null then for each Claim a { 'Claim.Type', 'Claim.Value' } is added. If duplicate claims are found then a { 'Claim.Type', List<object> } will be created to contain the duplicate values.

claimsCollection
IDictionary<String,Object>

If both claims and claimsCollection are not null then the values in claims will be combined with the values in claimsCollection. The values found in claimCollection take precedence over those found in claims, so any duplicate values will be overridden.

notBefore
Nullable<DateTime>

If notbefore.HasValue an { nbf, 'value' } claim is added, overwriting any 'nbf' claim in 'claims' and 'claimcollection' if present.

expires
Nullable<DateTime>

If expires.HasValue an { exp, 'value' } claim is added, overwriting any 'exp' claim in 'claims' and 'claimcollection' if present.

issuedAt
Nullable<DateTime>

If issuedAt.HasValue is 'true' an { iat, 'value' } claim is added, overwriting any 'iat' claim in 'claims' and 'claimcollection' if present.

Exceptions

If 'expires' <= 'notbefore'.

Remarks

Comparison is set to Ordinal

The 4 parameters: 'issuer', 'audience', 'notBefore', 'expires' take precedence over Claim(s) in 'claims' and 'claimcollection'. The values will be overridden.

Applies to