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.JwtHeaderContains JSON objects representing the cryptographic operations applied to the JWT and optionally any additional properties of the JWT.
payload
Type: System.IdentityModel.Tokens.JwtPayloadContains JSON objects representing the claims contained in the JWT. Each claim is a JSON object of the form of { Name, Value }.
jwtEncodedString
Type: System.StringThe results of encoding and applying the cryptographic operations to the JwtHeader and JwtPayload.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | This exception can be thrown in the following cases:
|
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
- 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.