Skip to main content

IBackChannelRequestStorage Interface

Abblix.Oidc.Server

Abblix.Oidc.Server.Features.BackChannelAuthentication.Interfaces

IBackChannelRequestStorage Interface

Defines the contract for a storage system responsible for persisting and retrieving backchannel authentication requests in the context of Client-Initiated Backchannel Authentication (CIBA).

public interface IBackChannelRequestStorage

Derived
BackChannelRequestStorage

Methods

IBackChannelRequestStorage.StoreAsync(BackChannelAuthenticationRequest, TimeSpan) Method

Asynchronously stores a backchannel authentication request in the storage system. This method saves the provided authentication request and sets its expiration based on the specified duration.

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

Parameters

authenticationRequest BackChannelAuthenticationRequest

The backchannel authentication request to store.

expiresIn System.TimeSpan

The duration after which the stored request will expire.

Returns

System.Threading.Tasks.Task<System.String>
A task that returns the ID of the stored authentication request.

IBackChannelRequestStorage.TryGetAsync(string) Method

Tries to retrieve a backchannel authentication request by its unique identifier. This method checks if a request exists for the specified ID and returns it if found.

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

Parameters

authenticationRequestId System.String

The unique identifier of the authentication request to retrieve.

Returns

System.Threading.Tasks.Task<BackChannelAuthenticationRequest>
A task that returns the authentication request if found; otherwise, null.

IBackChannelRequestStorage.TryRemoveAsync(string) Method

Atomically retrieves and removes a backchannel authentication request from storage. This operation prevents race conditions where multiple concurrent requests could retrieve the same authentication request before it's removed (poll mode double-retrieval vulnerability).

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

Parameters

authenticationRequestId System.String

The unique identifier of the authentication request to remove.

Returns

System.Threading.Tasks.Task<BackChannelAuthenticationRequest>
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.

IBackChannelRequestStorage.UpdateAsync(string, BackChannelAuthenticationRequest, TimeSpan) Method

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

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

Parameters

requestId System.String

The unique identifier of the authentication request to update.

request BackChannelAuthenticationRequest

The updated authentication request data.

expiresIn System.TimeSpan

The duration after which the request expires.

Returns

System.Threading.Tasks.Task
A task that completes when the request is updated in storage.