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

## AuthorizationRequestStorage Class

Provides storage and retrieval services for OAuth 2\.0 authorization requests using a distributed cache\.
This class is designed to handle the storage of [AuthorizationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.AuthorizationRequest 'Abblix\.Oidc\.Server\.Model\.AuthorizationRequest') objects and facilitate
their retrieval using unique request URIs, supporting scenarios such as the OAuth 2\.0 Pushed Authorization Requests
\(PAR\)\.

```csharp
public class AuthorizationRequestStorage : Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage
```

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

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

## AuthorizationRequestStorage\(IAuthorizationRequestUriGenerator, IEntityStorage, IEntityStorageKeyFactory\) Constructor {#Abblix.Oidc.Server.Features.Storages.AuthorizationRequestStorage.AuthorizationRequestStorage(Abblix.Oidc.Server.Features.RandomGenerators.IAuthorizationRequestUriGenerator,Abblix.Oidc.Server.Features.Storages.IEntityStorage,Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory)}

Provides storage and retrieval services for OAuth 2\.0 authorization requests using a distributed cache\.
This class is designed to handle the storage of [AuthorizationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.AuthorizationRequest 'Abblix\.Oidc\.Server\.Model\.AuthorizationRequest') objects and facilitate
their retrieval using unique request URIs, supporting scenarios such as the OAuth 2\.0 Pushed Authorization Requests
\(PAR\)\.

```csharp
public AuthorizationRequestStorage(Abblix.Oidc.Server.Features.RandomGenerators.IAuthorizationRequestUriGenerator authorizationRequestUriGenerator, Abblix.Oidc.Server.Features.Storages.IEntityStorage storage, Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory keyFactory);
```
#### Parameters

###### `authorizationRequestUriGenerator` [IAuthorizationRequestUriGenerator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.RandomGenerators.IAuthorizationRequestUriGenerator 'Abblix\.Oidc\.Server\.Features\.RandomGenerators\.IAuthorizationRequestUriGenerator') {#Abblix.Oidc.Server.Features.Storages.AuthorizationRequestStorage.AuthorizationRequestStorage(Abblix.Oidc.Server.Features.RandomGenerators.IAuthorizationRequestUriGenerator,Abblix.Oidc.Server.Features.Storages.IEntityStorage,Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory).authorizationRequestUriGenerator}

The generator used to create unique URIs for each authorization
            request\.

###### `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.Storages.AuthorizationRequestStorage.AuthorizationRequestStorage(Abblix.Oidc.Server.Features.RandomGenerators.IAuthorizationRequestUriGenerator,Abblix.Oidc.Server.Features.Storages.IEntityStorage,Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory).storage}

The persistent storage mechanism where authorization requests are stored\.

###### `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.Storages.AuthorizationRequestStorage.AuthorizationRequestStorage(Abblix.Oidc.Server.Features.RandomGenerators.IAuthorizationRequestUriGenerator,Abblix.Oidc.Server.Features.Storages.IEntityStorage,Abblix.Oidc.Server.Features.Storages.IEntityStorageKeyFactory).keyFactory}

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

## AuthorizationRequestStorage\.StoreAsync\(AuthorizationRequest, TimeSpan\) Method {#Abblix.Oidc.Server.Features.Storages.AuthorizationRequestStorage.StoreAsync(Abblix.Oidc.Server.Model.AuthorizationRequest,System.TimeSpan)}

Stores an authorization request in the distributed cache with a generated URI and a specified expiration time\.

```csharp
public System.Threading.Tasks.Task<Abblix.Oidc.Server.Endpoints.PushedAuthorization.Interfaces.PushedAuthorizationResponse> StoreAsync(Abblix.Oidc.Server.Model.AuthorizationRequest request, System.TimeSpan expiresIn);
```
#### Parameters

###### `request` [AuthorizationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.AuthorizationRequest 'Abblix\.Oidc\.Server\.Model\.AuthorizationRequest') {#Abblix.Oidc.Server.Features.Storages.AuthorizationRequestStorage.StoreAsync(Abblix.Oidc.Server.Model.AuthorizationRequest,System.TimeSpan).request}

The authorization request to store\.

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

The duration after which the stored request will expire and no longer be valid\. This
            duration is typically dictated by the OAuth 2\.0 server's configuration and the nature of the client's request\.

Implements [StoreAsync\(AuthorizationRequest, TimeSpan\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage#Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage.StoreAsync(Abblix.Oidc.Server.Model.AuthorizationRequest,System.TimeSpan) 'Abblix\.Oidc\.Server\.Features\.Storages\.IAuthorizationRequestStorage\.StoreAsync\(Abblix\.Oidc\.Server\.Model\.AuthorizationRequest, 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')[PushedAuthorizationResponse](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.PushedAuthorization.Interfaces.PushedAuthorizationResponse 'Abblix\.Oidc\.Server\.Endpoints\.PushedAuthorization\.Interfaces\.PushedAuthorizationResponse')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that resolves to a [PushedAuthorizationResponse](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.PushedAuthorization.Interfaces.PushedAuthorizationResponse 'Abblix\.Oidc\.Server\.Endpoints\.PushedAuthorization\.Interfaces\.PushedAuthorizationResponse'), which includes the stored request
            and its unique URI\. This response is used to facilitate subsequent authorization processes that may require
            accessing the request via its URI\.

## AuthorizationRequestStorage\.TryGetAsync\(Uri, bool\) Method {#Abblix.Oidc.Server.Features.Storages.AuthorizationRequestStorage.TryGetAsync(System.Uri,bool)}

Attempts to retrieve an authorization request from the distributed cache using its unique URI\.
Optionally removes the request from the cache depending on the [shouldRemove](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages.AuthorizationRequestStorage#Abblix.Oidc.Server.Features.Storages.AuthorizationRequestStorage.TryGetAsync(System.Uri,bool).shouldRemove 'Abblix\.Oidc\.Server\.Features\.Storages\.AuthorizationRequestStorage\.TryGetAsync\(System\.Uri, bool\)\.shouldRemove') parameter\.

```csharp
public System.Threading.Tasks.Task<Abblix.Oidc.Server.Model.AuthorizationRequest?> TryGetAsync(System.Uri requestUri, bool shouldRemove=false);
```
#### Parameters

###### `requestUri` [System\.Uri](https://learn.microsoft.com/en-us/dotnet/api/system.uri 'System\.Uri') {#Abblix.Oidc.Server.Features.Storages.AuthorizationRequestStorage.TryGetAsync(System.Uri,bool).requestUri}

The URI associated with the authorization request\.

###### `shouldRemove` [System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean') {#Abblix.Oidc.Server.Features.Storages.AuthorizationRequestStorage.TryGetAsync(System.Uri,bool).shouldRemove}

Whether to remove the request from the cache after retrieving it\. This is typically
            true for operations where the request is intended for single retrieval, such as after redirecting a client
            to an authorization endpoint\.

Implements [TryGetAsync\(Uri, bool\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage#Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage.TryGetAsync(System.Uri,bool) 'Abblix\.Oidc\.Server\.Features\.Storages\.IAuthorizationRequestStorage\.TryGetAsync\(System\.Uri, bool\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[AuthorizationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.AuthorizationRequest 'Abblix\.Oidc\.Server\.Model\.AuthorizationRequest')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A task that resolves to the retrieved [AuthorizationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.AuthorizationRequest 'Abblix\.Oidc\.Server\.Model\.AuthorizationRequest') if found; otherwise, null\.
            If the request is not found, it may have expired or been removed from the cache previously\.
