#### [Abblix\.Oidc\.Server](https://www.abblix.com/en/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Endpoints\.Token\.Validation](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Validation '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\.

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

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → ClientValidator

Implements [ITokenContextValidator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Validation.ITokenContextValidator 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Validation\.ITokenContextValidator')

### Remarks
This validator is responsible for authenticating the client making the token request\. It leverages the
[IClientAuthenticator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientAuthentication.IClientAuthenticator 'Abblix\.Oidc\.Server\.Features\.ClientAuthentication\.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 {#Abblix.Oidc.Server.Endpoints.Token.Validation.ClientValidator.ClientValidator(Abblix.Oidc.Server.Features.ClientAuthentication.IClientAuthenticator)}

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

```csharp
public ClientValidator(Abblix.Oidc.Server.Features.ClientAuthentication.IClientAuthenticator clientAuthenticator);
```
#### Parameters

###### `clientAuthenticator` [IClientAuthenticator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientAuthentication.IClientAuthenticator 'Abblix\.Oidc\.Server\.Features\.ClientAuthentication\.IClientAuthenticator') {#Abblix.Oidc.Server.Endpoints.Token.Validation.ClientValidator.ClientValidator(Abblix.Oidc.Server.Features.ClientAuthentication.IClientAuthenticator).clientAuthenticator}

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](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientAuthentication.IClientAuthenticator 'Abblix\.Oidc\.Server\.Features\.ClientAuthentication\.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 {#Abblix.Oidc.Server.Endpoints.Token.Validation.ClientValidator.ValidateAsync(Abblix.Oidc.Server.Endpoints.Token.Validation.TokenValidationContext)}

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\.

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

###### `context` [TokenValidationContext](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Validation.TokenValidationContext 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Validation\.TokenValidationContext') {#Abblix.Oidc.Server.Endpoints.Token.Validation.ClientValidator.ValidateAsync(Abblix.Oidc.Server.Endpoints.Token.Validation.TokenValidationContext).context}

The validation context containing the token request and client information\.

Implements [ValidateAsync\(TokenValidationContext\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Validation.ITokenContextValidator#Abblix.Oidc.Server.Endpoints.Token.Validation.ITokenContextValidator.ValidateAsync(Abblix.Oidc.Server.Endpoints.Token.Validation.TokenValidationContext) 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Validation\.ITokenContextValidator\.ValidateAsync\(Abblix\.Oidc\.Server\.Endpoints\.Token\.Validation\.TokenValidationContext\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A [OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError') if the client cannot be authenticated,
otherwise null indicating successful validation\.
