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

## IUserCodeVerificationService Interface

Defines the contract for a service that handles user code verification
in the Device Authorization Grant flow \(RFC 8628\)\.

```csharp
public interface IUserCodeVerificationService
```

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

## IUserCodeVerificationService\.ApproveAsync\(string, AuthorizedGrant\) Method {#Abblix.Oidc.Server.Features.DeviceAuthorization.Interfaces.IUserCodeVerificationService.ApproveAsync(string,Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant)}

Approves the device authorization request, linking the user's authorization to the pending device\.

```csharp
System.Threading.Tasks.Task<bool> ApproveAsync(string userCode, Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant authorizedGrant);
```
#### Parameters

###### `userCode` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.DeviceAuthorization.Interfaces.IUserCodeVerificationService.ApproveAsync(string,Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant).userCode}

The user\-entered verification code\.

###### `authorizedGrant` [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') {#Abblix.Oidc.Server.Features.DeviceAuthorization.Interfaces.IUserCodeVerificationService.ApproveAsync(string,Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant).authorizedGrant}

The authorized grant containing the user's authentication session and context\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that returns true if the approval was successful; false if the code is invalid or expired\.

## IUserCodeVerificationService\.DenyAsync\(string\) Method {#Abblix.Oidc.Server.Features.DeviceAuthorization.Interfaces.IUserCodeVerificationService.DenyAsync(string)}

Denies the device authorization request\.

```csharp
System.Threading.Tasks.Task<bool> DenyAsync(string userCode);
```
#### Parameters

###### `userCode` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.DeviceAuthorization.Interfaces.IUserCodeVerificationService.DenyAsync(string).userCode}

The user\-entered verification code\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that returns true if the denial was successful; false if the code is invalid or expired\.

## IUserCodeVerificationService\.VerifyAsync\(string\) Method {#Abblix.Oidc.Server.Features.DeviceAuthorization.Interfaces.IUserCodeVerificationService.VerifyAsync(string)}

Verifies a user code and returns the associated device authorization request details\.

```csharp
System.Threading.Tasks.Task<Abblix.Oidc.Server.Features.DeviceAuthorization.UserCodeVerificationResult> VerifyAsync(string userCode);
```
#### Parameters

###### `userCode` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.DeviceAuthorization.Interfaces.IUserCodeVerificationService.VerifyAsync(string).userCode}

The user\-entered verification code\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[UserCodeVerificationResult](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.DeviceAuthorization.UserCodeVerificationResult 'Abblix\.Oidc\.Server\.Features\.DeviceAuthorization\.UserCodeVerificationResult')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that returns the verification result containing request details if valid,
or an appropriate error if the code is invalid, expired, or already used\.
