JwtSecurityToken Constructor (String)

Constructs a JwtSecurityToken from a string in JSON Web Signature (JWS) Compact serialized format.

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

Syntax

'Declaration
Public Sub New ( _
    jwtEncodedString As String _
)
public JwtSecurityToken(
    string jwtEncodedString
)
public:
JwtSecurityToken(
    String^ jwtEncodedString
)
new : 
        jwtEncodedString:string -> JwtSecurityToken
public function JwtSecurityToken(
    jwtEncodedString : String
)

Parameters

  • jwtEncodedString
    Type: System.String

    A JSON Web Token that has been serialized in JWS Compact serialized format.

Exceptions

Exception Condition
ArgumentNullException

jwtEncodedString is null.

ArgumentException

This exception can be thrown if jwtEncodedString contains only whitespace or if jwtEncodedString is not in JWS Compact serialized format.

Remarks

The contents of this JwtSecurityToken have not been validated, the JSON Web Token is simply decoded. Validation can be accomplished using ValidateToken.

.NET Framework Security

See Also

Reference

JwtSecurityToken Class

JwtSecurityToken Overload

System.IdentityModel.Tokens Namespace