IAuthorizationRequestStorage Interface
Abblix.Oidc.Server
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.
public interface IAuthorizationRequestStorage
Derived
↳ AuthorizationRequestStorage
Methods
IAuthorizationRequestStorage.StoreAsync(AuthorizationRequest, TimeSpan) Method
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.
System.Threading.Tasks.Task<Abblix.Oidc.Server.Endpoints.PushedAuthorization.Interfaces.PushedAuthorizationResponse> StoreAsync(Abblix.Oidc.Server.Model.AuthorizationRequest request, System.TimeSpan expiresIn);
Parameters
request AuthorizationRequest
The AuthorizationRequest instance to be stored.
expiresIn System.TimeSpan
The duration after which the stored request should expire and be considered invalid.
Returns
System.Threading.Tasks.Task<PushedAuthorizationResponse>
A System.Threading.Tasks.Task that, when completed successfully,
yields a PushedAuthorizationResponse containing the unique identifier of the stored request
and its expiration information.
IAuthorizationRequestStorage.TryGetAsync(Uri, bool) Method
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.
System.Threading.Tasks.Task<Abblix.Oidc.Server.Model.AuthorizationRequest?> TryGetAsync(System.Uri requestUri, bool shouldRemove=false);
Parameters
requestUri System.Uri
The unique identifier of the authorization request, typically a URI, used to locate the request in storage.
shouldRemove System.Boolean
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<AuthorizationRequest>
A System.Threading.Tasks.Task that, when completed successfully, yields
the AuthorizationRequest associated with the specified identifier,
or null if no such request exists or if it has expired.