#### [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')

## IAuthorizationRequestStorage Interface

Provides mechanisms for securely storing and retrieving OAuth 2\.0 authorization requests\.
This interface abstracts the storage layer, allowing for implementation\-specific details
such as database, cache or filesystem storage\.

```csharp
public interface IAuthorizationRequestStorage
```

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

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

Asynchronously stores the provided authorization request in a secure manner and returns a unique identifier
for it\. This identifier can be used to retrieve the request at a later time, facilitating mechanisms
like the Pushed Authorization Request \(PAR\)\. This method also accepts an expiration time for the request,
allowing the storage mechanism to automatically invalidate the request after a certain period\.

```csharp
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.IAuthorizationRequestStorage.StoreAsync(Abblix.Oidc.Server.Model.AuthorizationRequest,System.TimeSpan).request}

The [AuthorizationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.AuthorizationRequest 'Abblix\.Oidc\.Server\.Model\.AuthorizationRequest') instance to be stored\.

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

The duration after which the stored request should expire and be considered invalid\.

#### 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 [System\.Threading\.Tasks\.Task](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task 'System\.Threading\.Tasks\.Task') that, when completed successfully,
            yields 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') containing the unique identifier of the stored request
            and its expiration information\.

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

Asynchronously retrieves an authorization request using a previously stored unique identifier\.
This method facilitates the retrieval of authorization requests for further processing or validation\.
The shouldRemove parameter controls whether the request is deleted from storage upon retrieval,
ensuring it cannot be retrieved again, which is essential for one\-time use scenarios like authorization codes\.

```csharp
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.IAuthorizationRequestStorage.TryGetAsync(System.Uri,bool).requestUri}

The unique identifier of the authorization request, typically a URI,
            used to locate the request in storage\.

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

Specifies whether the request should be removed from storage on retrieval\.
            This is useful for one\-time use scenarios, ensuring that an authorization request cannot be reused\.

#### 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 [System\.Threading\.Tasks\.Task](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task 'System\.Threading\.Tasks\.Task') that, when completed successfully, yields
            the [AuthorizationRequest](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.AuthorizationRequest 'Abblix\.Oidc\.Server\.Model\.AuthorizationRequest') associated with the specified identifier,
            or null if no such request exists or if it has expired\.
