Interface IJwtReader
Service for parsing and validating Json Web Tokens.
public interface IJwtReader
Methods
GetValidatedJsonWebTokenAsync(string)
Validates a raw JSON Web Token and returns the content represented as a JsonWebToken instance.
Task<JsonWebToken> GetValidatedJsonWebTokenAsync(string jwt)
Parameters
jwtstringThe raw JSON Web Token.
Returns
- Task<JsonWebToken>
The raw JSON Web Token represented as a JsonWebToken instance.
ParseAsync(string, bool)
Parse and validate a raw JSON Web Token.
Task<IEnumerable<Claim>> ParseAsync(string jwt, bool validateLifetime)
Parameters
jwtstringThe raw JSON Web Token.
validateLifetimeboolIndicates whether or not the expiry and not before claims should be used to validate the lifetime of the token.
Returns
- Task<IEnumerable<Claim>>
The set of claims from the JSON Web Token.