Share via


JwtPayload.AddClaim Method

Adds a JSON object representing the Claim to the JwtPayload.

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

Syntax

'Declaration
Public Sub AddClaim ( _
    claim As Claim _
)
public void AddClaim(
    Claim claim
)
public:
void AddClaim(
    Claim^ claim
)
member AddClaim : 
        claim:Claim -> unit
public function AddClaim(
    claim : Claim
)

Parameters

  • claim
    Type: System.Security.Claims.Claim

    { 'Claim.Type', 'Claim.Value' } is added. If a JSON object is found with a name that equals a Type then a { 'Claim.Type', List<object> } will be created to contain the duplicate values.

Exceptions

Exception Condition
ArgumentNullException

claim is null.

Remarks

See AddClaims for details on how OutboundClaimTypeMap is applied.

.NET Framework Security

See Also

Reference

JwtPayload Class

System.IdentityModel.Tokens Namespace