Table of Contents

Class DefaultTokenRequestValidator

Namespace
Fdyay.IdentityServer.Validation
Assembly
Fdyay.IdentityServer.Core.dll

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

public sealed class DefaultTokenRequestValidator : ITokenRequestValidator
Inheritance
DefaultTokenRequestValidator
Implements
Inherited Members

Constructors

DefaultTokenRequestValidator(IAuthorizationCodeStore, IResourceValidator, IRefreshTokenService, IProfileService, IDeviceCodeValidator, IBackchannelAuthenticationRequestIdValidator, IEnumerable<IExtensionGrantValidator>, IOptions<IdentityServerOptions>, TimeProvider)

A validator without the resource store, which cannot use TokenRequestDefaultScopesFromResourceStore.

public DefaultTokenRequestValidator(IAuthorizationCodeStore codes, IResourceValidator resourceValidator, IRefreshTokenService refreshTokenService, IProfileService profileService, IDeviceCodeValidator deviceCodes, IBackchannelAuthenticationRequestIdValidator backchannelRequests, IEnumerable<IExtensionGrantValidator> extensionGrants, IOptions<IdentityServerOptions> options, TimeProvider time)

Parameters

codes IAuthorizationCodeStore
resourceValidator IResourceValidator
refreshTokenService IRefreshTokenService
profileService IProfileService
deviceCodes IDeviceCodeValidator
backchannelRequests IBackchannelAuthenticationRequestIdValidator
extensionGrants IEnumerable<IExtensionGrantValidator>
options IOptions<IdentityServerOptions>
time TimeProvider

Remarks

Kept so a host's build does not break; the container chooses the overload taking the store.

DefaultTokenRequestValidator(IAuthorizationCodeStore, IResourceValidator, IResourceStore, IRefreshTokenService, IProfileService, IDeviceCodeValidator, IBackchannelAuthenticationRequestIdValidator, IEnumerable<IExtensionGrantValidator>, IOptions<IdentityServerOptions>, TimeProvider)

public DefaultTokenRequestValidator(IAuthorizationCodeStore codes, IResourceValidator resourceValidator, IResourceStore resourceStore, IRefreshTokenService refreshTokenService, IProfileService profileService, IDeviceCodeValidator deviceCodes, IBackchannelAuthenticationRequestIdValidator backchannelRequests, IEnumerable<IExtensionGrantValidator> extensionGrants, IOptions<IdentityServerOptions> options, TimeProvider time)

Parameters

codes IAuthorizationCodeStore

Where authorization codes are kept, for the authorization_code grant.

resourceValidator IResourceValidator

Checks the requested scopes and resource indicators against the client and the registered resources.

resourceStore IResourceStore

Where a token request naming no scope finds the client's allowed scopes, when TokenRequestDefaultScopesFromResourceStore is set.

refreshTokenService IRefreshTokenService

Validates and rotates refresh tokens, for the refresh_token grant.

profileService IProfileService

Asked whether the user is still active before a token is issued.

deviceCodes IDeviceCodeValidator

Validates device codes, for the device flow.

backchannelRequests IBackchannelAuthenticationRequestIdValidator

Validates auth_req_ids, for CIBA.

extensionGrants IEnumerable<IExtensionGrantValidator>

The host's extension grant validators, one per grant type.

options IOptions<IdentityServerOptions>

This server's options.

time TimeProvider

The clock.

Methods

ValidateAsync(Client, ParsedSecret?, IReadOnlyDictionary<string, string>, CancellationToken)

Validates a request from a client that authenticated with secret.

public Task<TokenRequestValidationResult> ValidateAsync(Client client, ParsedSecret? secret, IReadOnlyDictionary<string, string> parameters, CancellationToken cancellationToken = default)

Parameters

client Client
secret ParsedSecret
parameters IReadOnlyDictionary<string, string>
cancellationToken CancellationToken

Returns

Task<TokenRequestValidationResult>

Remarks

What the token endpoint calls, so the validated request carries the credential as Duende's ValidatedRequest.Secret. A validator written before it answers through the overload above, and the credential is set on what it returns.

Exceptions

ArgumentNullException

client or parameters is null.

ValidateAsync(Client, IReadOnlyDictionary<string, string>, CancellationToken)

Validates a token request from an authenticated client, by its grant_type.

public Task<TokenRequestValidationResult> ValidateAsync(Client client, IReadOnlyDictionary<string, string> parameters, CancellationToken cancellationToken = default)

Parameters

client Client

The authenticated client making the request.

parameters IReadOnlyDictionary<string, string>

The request's form parameters.

cancellationToken CancellationToken

Cancels the validation.

Returns

Task<TokenRequestValidationResult>

The validated request, or the error to answer with.