Share via


JwtSecurityToken Constructor (String, String, IEnumerable<Claim>, Lifetime, SigningCredentials)

Constructs a JwtSecurityToken specifying optional parameters.

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

Syntax

'Declaration
Public Sub New ( _
    issuer As String, _
    audience As String, _
    claims As IEnumerable(Of Claim), _
    lifetime As Lifetime, _
    signingCredentials As SigningCredentials _
)
public JwtSecurityToken(
    string issuer,
    string audience,
    IEnumerable<Claim> claims,
    Lifetime lifetime,
    SigningCredentials signingCredentials
)
public:
JwtSecurityToken(
    String^ issuer, 
    String^ audience, 
    IEnumerable<Claim^>^ claims, 
    Lifetime^ lifetime, 
    SigningCredentials^ signingCredentials
)
new : 
        issuer:string * 
        audience:string * 
        claims:IEnumerable<Claim> * 
        lifetime:Lifetime * 
        signingCredentials:SigningCredentials -> JwtSecurityToken
public function JwtSecurityToken(
    issuer : String, 
    audience : String, 
    claims : IEnumerable<Claim>, 
    lifetime : Lifetime, 
    signingCredentials : SigningCredentials
)

Parameters

  • issuer
    Type: System.String

    If this value is not null, a { iss, 'issuer' } claim will be added.

  • audience
    Type: System.String

    If this value is not null, a { aud, 'audience' } claim will be added.

  • claims
    Type: System.Collections.Generic.IEnumerable<Claim>

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

.NET Framework Security

See Also

Reference

JwtSecurityToken Class

JwtSecurityToken Overload

System.IdentityModel.Tokens Namespace