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.StringIf this value is not null, a { iss, 'issuer' } claim will be added.
audience
Type: System.StringIf 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.
lifetime
Type: System.IdentityModel.Protocols.WSTrust.LifetimeIf this value is not null, and ifHasValue is true, a { nbf, 'value' } is added.
signingCredentials
Type: System.IdentityModel.Tokens.SigningCredentialsThe SigningCredentials that will be or was used to sign the JwtSecurityToken. See JwtHeader for more information about the Header Parameter(s).
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.