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

## ITokenRequestValidator Interface

Validates an incoming OAuth 2\.0 token request \(RFC 6749 §3\.2\) against the rules required by the
requested `grant_type`: client authentication, grant ownership \(e\.g\. an authorization code
MUST have been issued to the authenticated client per OIDC Core 1\.0 §3\.1\.3\.2\), redirect URI
equivalence for code exchange, scope and resource \(RFC 8707\) consistency, and PKCE verifier
matching \(RFC 7636 §4\.5\) where applicable\.

```csharp
public interface ITokenRequestValidator
```

Derived  
↳ [TokenRequestValidator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.TokenRequestValidator 'Abblix\.Oidc\.Server\.Endpoints\.Token\.TokenRequestValidator')
### Methods

## ITokenRequestValidator\.ValidateAsync\(TokenRequest, ClientRequest\) Method {#Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenRequestValidator.ValidateAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Oidc.Server.Model.ClientRequest)}

Validates the request and returns a [ValidTokenRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.ValidTokenRequest 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.ValidTokenRequest') ready for token issuance,
or an [OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError') using one of the codes from RFC 6749 §5\.2 \(e\.g\. `invalid_grant`,
`invalid_client`, `unsupported_grant_type`\)\.

```csharp
System.Threading.Tasks.Task<Abblix.Utils.Result<Abblix.Oidc.Server.Endpoints.Token.Interfaces.ValidTokenRequest,Abblix.Oidc.Server.Common.OidcError>> ValidateAsync(Abblix.Oidc.Server.Model.TokenRequest tokenRequest, Abblix.Oidc.Server.Model.ClientRequest clientRequest);
```
#### Parameters

###### `tokenRequest` [TokenRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.TokenRequest 'Abblix\.Oidc\.Server\.Model\.TokenRequest') {#Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenRequestValidator.ValidateAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Oidc.Server.Model.ClientRequest).tokenRequest}

###### `clientRequest` [ClientRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.ClientRequest 'Abblix\.Oidc\.Server\.Model\.ClientRequest') {#Abblix.Oidc.Server.Endpoints.Token.Interfaces.ITokenRequestValidator.ValidateAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Oidc.Server.Model.ClientRequest).clientRequest}

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Abblix\.Utils\.Result&lt;](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[ValidTokenRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.ValidTokenRequest 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.ValidTokenRequest')[,](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[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/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')
