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.StringA 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
- 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.