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
codesIAuthorizationCodeStoreresourceValidatorIResourceValidatorrefreshTokenServiceIRefreshTokenServiceprofileServiceIProfileServicedeviceCodesIDeviceCodeValidatorbackchannelRequestsIBackchannelAuthenticationRequestIdValidatorextensionGrantsIEnumerable<IExtensionGrantValidator>optionsIOptions<IdentityServerOptions>timeTimeProvider
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
codesIAuthorizationCodeStoreWhere authorization codes are kept, for the
authorization_codegrant.resourceValidatorIResourceValidatorChecks the requested scopes and resource indicators against the client and the registered resources.
resourceStoreIResourceStoreWhere a token request naming no scope finds the client's allowed scopes, when TokenRequestDefaultScopesFromResourceStore is set.
refreshTokenServiceIRefreshTokenServiceValidates and rotates refresh tokens, for the
refresh_tokengrant.profileServiceIProfileServiceAsked whether the user is still active before a token is issued.
deviceCodesIDeviceCodeValidatorValidates device codes, for the device flow.
backchannelRequestsIBackchannelAuthenticationRequestIdValidatorValidates
auth_req_ids, for CIBA.extensionGrantsIEnumerable<IExtensionGrantValidator>The host's extension grant validators, one per grant type.
optionsIOptions<IdentityServerOptions>This server's options.
timeTimeProviderThe 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
clientClientsecretParsedSecretparametersIReadOnlyDictionary<string, string>cancellationTokenCancellationToken
Returns
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
clientorparametersisnull.
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
clientClientThe authenticated client making the request.
parametersIReadOnlyDictionary<string, string>The request's form parameters.
cancellationTokenCancellationTokenCancels the validation.
Returns
- Task<TokenRequestValidationResult>
The validated request, or the error to answer with.