Table of Contents

Class ApiSecretValidator

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 ApiSecretValidator : IApiSecretValidator
Inheritance
ApiSecretValidator
Implements
Inherited Members

Constructors

ApiSecretValidator(IResourceStore, ISecretsListValidator, IEventService)

Creates the validator.

public ApiSecretValidator(IResourceStore resources, ISecretsListValidator secretValidator, IEventService events)

Parameters

resources IResourceStore

The registered API resources.

secretValidator ISecretsListValidator

Checks the credential against the API's registered secrets.

events IEventService

Where the API authentication success and failure events go.

Methods

ValidateAsync(ParsedSecret, CancellationToken)

Finds the API resource the credential names and checks the credential against the API's secrets.

public Task<ApiSecretValidationResult> ValidateAsync(ParsedSecret parsedSecret, CancellationToken cancellationToken = default)

Parameters

parsedSecret ParsedSecret

The API name and credential a secret parser read off the request.

cancellationToken CancellationToken

Cancels the resource lookup and the secret validation.

Returns

Task<ApiSecretValidationResult>

The authenticated API resource, or a failure.

Remarks

Refuses a missing name and an unknown or disabled API. Unlike a client, an API always has to present a valid credential. The reason for a failure is on the failure event, not the result.

Exceptions

ArgumentNullException

parsedSecret is null.