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

## BackChannelRequestStorage Class

Implements the storage of backchannel authentication requests, allowing for persistence
and retrieval of authentication request data in the context of Client\-Initiated Backchannel Authentication \(CIBA\)\.

```csharp
public class BackChannelRequestStorage : Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IBackChannelRequestStorage
```

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

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

## BackChannelRequestStorage\(IEntityStorage, IAuthenticationRequestIdGenerator, IEntityStorageKeyFactory\) Constructor {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.BackChannelRequestStorage(Abblix.Oidc.Server.Features.Storages.IEntityStorage,Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IAuthenticationRequestIdGenerator,Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory)}

Implements the storage of backchannel authentication requests, allowing for persistence
and retrieval of authentication request data in the context of Client\-Initiated Backchannel Authentication \(CIBA\)\.

```csharp
public BackChannelRequestStorage(Abblix.Oidc.Server.Features.Storages.IEntityStorage storage, Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IAuthenticationRequestIdGenerator authenticationRequestIdGenerator, Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory keyFactory);
```
#### Parameters

###### `storage` [IEntityStorage](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages.IEntityStorage 'Abblix\.Oidc\.Server\.Features\.Storages\.IEntityStorage') {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.BackChannelRequestStorage(Abblix.Oidc.Server.Features.Storages.IEntityStorage,Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IAuthenticationRequestIdGenerator,Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory).storage}

The storage system used for persisting authentication requests\.

###### `authenticationRequestIdGenerator` [IAuthenticationRequestIdGenerator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IAuthenticationRequestIdGenerator 'Abblix\.Oidc\.Server\.Features\.BackChannelAuthentication\.Interfaces\.IAuthenticationRequestIdGenerator') {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.BackChannelRequestStorage(Abblix.Oidc.Server.Features.Storages.IEntityStorage,Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IAuthenticationRequestIdGenerator,Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory).authenticationRequestIdGenerator}

Generator for creating unique authentication request IDs\.

###### `keyFactory` [IEntityStorageKeyFactory](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory 'Abblix\.Oidc\.Server\.Features\.Storages\.IEntityStorageKeyFactory') {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.BackChannelRequestStorage(Abblix.Oidc.Server.Features.Storages.IEntityStorage,Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IAuthenticationRequestIdGenerator,Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory).keyFactory}

The factory for generating standardized storage keys\.
### Methods

## BackChannelRequestStorage\.StoreAsync\(BackChannelAuthenticationRequest, TimeSpan\) Method {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.StoreAsync(Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest,System.TimeSpan)}

Asynchronously stores a backchannel authentication request and generates a unique identifier for it\.
This method also sets an expiration duration for the stored request\.

```csharp
public System.Threading.Tasks.Task<string> StoreAsync(Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest authenticationRequest, System.TimeSpan expiresIn);
```
#### Parameters

###### `authenticationRequest` [BackChannelAuthenticationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest 'Abblix\.Oidc\.Server\.Features\.BackChannelAuthentication\.BackChannelAuthenticationRequest') {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.StoreAsync(Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest,System.TimeSpan).authenticationRequest}

The backchannel authentication request to store\.

###### `expiresIn` [System\.TimeSpan](https://learn.microsoft.com/en-us/dotnet/api/system.timespan 'System\.TimeSpan') {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.StoreAsync(Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest,System.TimeSpan).expiresIn}

The duration after which the stored request will expire\.

Implements [StoreAsync\(BackChannelAuthenticationRequest, TimeSpan\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IBackChannelRequestStorage#Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IBackChannelRequestStorage.StoreAsync(Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest,System.TimeSpan) 'Abblix\.Oidc\.Server\.Features\.BackChannelAuthentication\.Interfaces\.IBackChannelRequestStorage\.StoreAsync\(Abblix\.Oidc\.Server\.Features\.BackChannelAuthentication\.BackChannelAuthenticationRequest, System\.TimeSpan\)')

#### 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\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that returns the unique ID of the stored authentication request\.

## BackChannelRequestStorage\.TryGetAsync\(string\) Method {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.TryGetAsync(string)}

Tries to retrieve a backchannel authentication request by its unique identifier\.

```csharp
public System.Threading.Tasks.Task<Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest?> TryGetAsync(string authenticationRequestId);
```
#### Parameters

###### `authenticationRequestId` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.TryGetAsync(string).authenticationRequestId}

The unique identifier of the authentication request to retrieve\.

Implements [TryGetAsync\(string\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IBackChannelRequestStorage#Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IBackChannelRequestStorage.TryGetAsync(string) 'Abblix\.Oidc\.Server\.Features\.BackChannelAuthentication\.Interfaces\.IBackChannelRequestStorage\.TryGetAsync\(string\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[BackChannelAuthenticationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest 'Abblix\.Oidc\.Server\.Features\.BackChannelAuthentication\.BackChannelAuthenticationRequest')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that returns the authentication request if found;
otherwise, null\.

## BackChannelRequestStorage\.TryRemoveAsync\(string\) Method {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.TryRemoveAsync(string)}

Atomically retrieves and removes a backchannel authentication request from storage\.
This prevents race conditions in poll mode where concurrent requests could both retrieve
the same authentication request before removal, leading to duplicate token issuance\.

```csharp
public System.Threading.Tasks.Task<Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest?> TryRemoveAsync(string authenticationRequestId);
```
#### Parameters

###### `authenticationRequestId` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.TryRemoveAsync(string).authenticationRequestId}

The unique identifier of the authentication request to remove\.

Implements [TryRemoveAsync\(string\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IBackChannelRequestStorage#Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IBackChannelRequestStorage.TryRemoveAsync(string) 'Abblix\.Oidc\.Server\.Features\.BackChannelAuthentication\.Interfaces\.IBackChannelRequestStorage\.TryRemoveAsync\(string\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[BackChannelAuthenticationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest 'Abblix\.Oidc\.Server\.Features\.BackChannelAuthentication\.BackChannelAuthenticationRequest')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that returns the authentication request if it existed and was successfully removed;
otherwise, null if the request was not found or already removed by another concurrent request\.

## BackChannelRequestStorage\.UpdateAsync\(string, BackChannelAuthenticationRequest, TimeSpan\) Method {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.UpdateAsync(string,Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest,System.TimeSpan)}

Updates an existing backchannel authentication request in storage\.
Used in ping mode to update request status when user completes authentication\.

```csharp
public System.Threading.Tasks.Task UpdateAsync(string requestId, Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest request, System.TimeSpan expiresIn);
```
#### Parameters

###### `requestId` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.UpdateAsync(string,Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest,System.TimeSpan).requestId}

The unique identifier of the authentication request to update\.

###### `request` [BackChannelAuthenticationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest 'Abblix\.Oidc\.Server\.Features\.BackChannelAuthentication\.BackChannelAuthenticationRequest') {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.UpdateAsync(string,Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest,System.TimeSpan).request}

The updated authentication request data\.

###### `expiresIn` [System\.TimeSpan](https://learn.microsoft.com/en-us/dotnet/api/system.timespan 'System\.TimeSpan') {#Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelRequestStorage.UpdateAsync(string,Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest,System.TimeSpan).expiresIn}

The duration after which the request expires\.

Implements [UpdateAsync\(string, BackChannelAuthenticationRequest, TimeSpan\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IBackChannelRequestStorage#Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces.IBackChannelRequestStorage.UpdateAsync(string,Abblix.Oidc.Server.Features.BackChannelAuthentication.BackChannelAuthenticationRequest,System.TimeSpan) 'Abblix\.Oidc\.Server\.Features\.BackChannelAuthentication\.Interfaces\.IBackChannelRequestStorage\.UpdateAsync\(string, Abblix\.Oidc\.Server\.Features\.BackChannelAuthentication\.BackChannelAuthenticationRequest, System\.TimeSpan\)')

#### Returns
[System\.Threading\.Tasks\.Task](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task 'System\.Threading\.Tasks\.Task')  
A task that completes when the request is updated in storage\.
