Skip to main content

ClientValidator Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Endpoints.Token.Validation

ClientValidator Class

Validates the client information in the context of a token request, ensuring that the client is properly authenticated.

public class ClientValidator : Abblix.Oidc.Server.Endpoints.Token.Validation.ITokenContextValidator

Inheritance System.Object → ClientValidator

Implements ITokenContextValidator

Remarks

This validator is responsible for authenticating the client making the token request. It leverages the IClientAuthenticator to perform the authentication, and if successful, attaches the client information to the validation context. If the authentication fails, it returns an error indicating that the client is not authorized.

Constructors

ClientValidator(IClientAuthenticator) Constructor

Validates the client information in the context of a token request, ensuring that the client is properly authenticated.

public ClientValidator(Abblix.Oidc.Server.Features.ClientAuthentication.IClientAuthenticator clientAuthenticator);

Parameters

clientAuthenticator IClientAuthenticator

The client authenticator used to authenticate the client.

Remarks

This validator is responsible for authenticating the client making the token request. It leverages the IClientAuthenticator to perform the authentication, and if successful, attaches the client information to the validation context. If the authentication fails, it returns an error indicating that the client is not authorized.

Methods

ClientValidator.ValidateAsync(TokenValidationContext) Method

Asynchronously validates the client in the token request context. This method checks if the client can be authenticated using the provided client request information. If the client is successfully authenticated, the client information is added to the context; otherwise, an error is returned.

public System.Threading.Tasks.Task<Abblix.Oidc.Server.Common.OidcError?> ValidateAsync(Abblix.Oidc.Server.Endpoints.Token.Validation.TokenValidationContext context);

Parameters

context TokenValidationContext

The validation context containing the token request and client information.

Implements ValidateAsync(TokenValidationContext)

Returns

System.Threading.Tasks.Task<OidcError>
A OidcError if the client cannot be authenticated, otherwise null indicating successful validation.