Table of Contents

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

token string

The token as presented: a compact JWT or a reference token handle.

issuer string

This server's issuer, which a JWT's iss must match.

cancellationToken CancellationToken

Cancels 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

token string
issuer string
clientId string
cancellationToken CancellationToken

Returns

Task<IdentityTokenValidationResult>

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.