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
resourcesIResourceStoreThe registered API resources.
secretValidatorISecretsListValidatorChecks the credential against the API's registered secrets.
eventsIEventServiceWhere 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
parsedSecretParsedSecretThe API name and credential a secret parser read off the request.
cancellationTokenCancellationTokenCancels 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
parsedSecretisnull.