JwtSecurityTokenHandler.ReadToken Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ReadToken(String) |
Converts a string into an instance of JwtSecurityToken. |
ReadToken(XmlReader, TokenValidationParameters) |
Deserializes token with the provided TokenValidationParameters. |
ReadToken(String)
Converts a string into an instance of JwtSecurityToken.
public override Microsoft.IdentityModel.Tokens.SecurityToken ReadToken (string token);
override this.ReadToken : string -> Microsoft.IdentityModel.Tokens.SecurityToken
Public Overrides Function ReadToken (token As String) As SecurityToken
Parameters
- token
- String
A 'JSON Web Token' (JWT) in JWS or JWE Compact Serialization Format.
Returns
Exceptions
token
is null or empty.
Remarks
If the token
is in JWE Compact Serialization format, only the protected header will be deserialized.
This method is unable to decrypt the payload. Use ValidateToken(String, TokenValidationParameters, SecurityToken)to obtain the payload.
Applies to
ReadToken(XmlReader, TokenValidationParameters)
Deserializes token with the provided TokenValidationParameters.
public override Microsoft.IdentityModel.Tokens.SecurityToken ReadToken (System.Xml.XmlReader reader, Microsoft.IdentityModel.Tokens.TokenValidationParameters validationParameters);
override this.ReadToken : System.Xml.XmlReader * Microsoft.IdentityModel.Tokens.TokenValidationParameters -> Microsoft.IdentityModel.Tokens.SecurityToken
Public Overrides Function ReadToken (reader As XmlReader, validationParameters As TokenValidationParameters) As SecurityToken
Parameters
- validationParameters
- TokenValidationParameters
The TokenValidationParameters to be used for validating the token.
Returns
The SecurityToken
Remarks
This method is not current supported.