JwtPayload.AddClaims(IEnumerable<Claim>) Method

Definition

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

public void AddClaims (System.Collections.Generic.IEnumerable<System.Security.Claims.Claim> claims);
member this.AddClaims : seq<System.Security.Claims.Claim> -> unit
Public Sub AddClaims (claims As IEnumerable(Of Claim))

Parameters

claims
System.Collections.Generic.IEnumerable<System.Security.Claims.Claim>

For each System.Security.Claims.Claim a JSON pair { '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.

Exceptions

System.ArgumentNullException

claims is null.

Remarks

Any System.Security.Claims.Claim in the System.Collections.Generic.IEnumerable`1 that is null, will be ignored.

Applies to