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

## IUserCredentialsAuthenticator Interface

Validates a username and password pair against the host's user store and produces an authorized grant
when the credentials are correct\. Used by the Resource Owner Password Credentials grant
\(`grant_type=password`\) at the token endpoint, so the host can plug its own identity backend
behind the OAuth flow\.

```csharp
public interface IUserCredentialsAuthenticator
```
### Methods

## IUserCredentialsAuthenticator\.ValidateAsync\(string, string, AuthorizationContext\) Method {#Abblix.Oidc.Server.Common.Interfaces.IUserCredentialsAuthenticator.ValidateAsync(string,string,Abblix.Oidc.Server.Common.AuthorizationContext)}

Validates user credentials \(username and password\) and returns a grant authorization result\.

```csharp
System.Threading.Tasks.Task<Abblix.Utils.Result<Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant,Abblix.Oidc.Server.Common.OidcError>> ValidateAsync(string userName, string password, Abblix.Oidc.Server.Common.AuthorizationContext context);
```
#### Parameters

###### `userName` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Common.Interfaces.IUserCredentialsAuthenticator.ValidateAsync(string,string,Abblix.Oidc.Server.Common.AuthorizationContext).userName}

The username provided by the user\.

###### `password` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Common.Interfaces.IUserCredentialsAuthenticator.ValidateAsync(string,string,Abblix.Oidc.Server.Common.AuthorizationContext).password}

The password provided by the user\.

###### `context` [AuthorizationContext](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.AuthorizationContext 'Abblix\.Oidc\.Server\.Common\.AuthorizationContext') {#Abblix.Oidc.Server.Common.Interfaces.IUserCredentialsAuthenticator.ValidateAsync(string,string,Abblix.Oidc.Server.Common.AuthorizationContext).context}

The authorization context associated with the request\.

#### 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')[AuthorizedGrant](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.AuthorizedGrant')[,](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')  
A task that represents the asynchronous validation operation and returns the grant authorization result\.
