Interface ITokenValidator
- Namespace
- Fdyay.IdentityServer.Validation
- Assembly
- Fdyay.IdentityServer.Core.dll
Validates access tokens (self-contained JWTs and reference handles).
public interface ITokenValidator
Methods
ValidateAccessTokenAsync(string, string, CancellationToken)
Validates an access token presented to this server, whether a JWT or a reference handle.
Task<AccessTokenValidationResult> ValidateAccessTokenAsync(string token, string issuer, CancellationToken cancellationToken = default)
Parameters
tokenstringThe token as presented: a compact JWT or a reference token handle.
issuerstringThis server's issuer, which a JWT's
issmust match.cancellationTokenCancellationTokenCancels the key, store, session and profile lookups.
Returns
- Task<AccessTokenValidationResult>
The token's claims and audiences, or the error it was refused with.
ValidateIdentityTokenHintAsync(string, string, string, CancellationToken)
Validates an identity token this server issued to clientId, presented back as a hint.
Task<IdentityTokenValidationResult> ValidateIdentityTokenHintAsync(string token, string issuer, string clientId, CancellationToken cancellationToken = default)
Parameters
tokenstringissuerstringclientIdstringcancellationTokenCancellationToken
Returns
Remarks
Lifetime is deliberately not checked: a hint names a user, and an expired identity token still names the subject this server issued it for. Everything that says whose token it is, is checked.