JwtSecurityToken Constructor (JwtHeader, JwtPayload, String)

Constructs a JwtSecurityToken where the JwtHeader contains the crypto algorithms applied to the encoded JwtHeader and JwtPayload. The jwtEncodedString is the result of those operations.

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

Syntax

'Declaration
Public Sub New ( _
    header As JwtHeader, _
    payload As JwtPayload, _
    jwtEncodedString As String _
)
public JwtSecurityToken(
    JwtHeader header,
    JwtPayload payload,
    string jwtEncodedString
)
public:
JwtSecurityToken(
    JwtHeader^ header, 
    JwtPayload^ payload, 
    String^ jwtEncodedString
)
new : 
        header:JwtHeader * 
        payload:JwtPayload * 
        jwtEncodedString:string -> JwtSecurityToken
public function JwtSecurityToken(
    header : JwtHeader, 
    payload : JwtPayload, 
    jwtEncodedString : String
)

Parameters

  • header
    Type: System.IdentityModel.Tokens.JwtHeader

    Contains JSON objects representing the cryptographic operations applied to the JWT and optionally any additional properties of the JWT.

Exceptions

Exception Condition
ArgumentNullException

This exception can be thrown in the following cases:

  • header is null.

  • Payload is null.

  • jwtEncodedString is null.

ArgumentException

This exception can be thrown if jwtEncodedString contains only whitespace or if jwtEncodedString is not in JSON Web Signature (JWS) Compact serialized format.

.NET Framework Security

See Also

Reference

JwtSecurityToken Class

JwtSecurityToken Overload

System.IdentityModel.Tokens Namespace