Skip to main content

RequestUriFetcher Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Endpoints.Authorization.RequestFetching

RequestUriFetcher Class

Handles fetching of authorization request objects from a specified request URI. This class is responsible for retrieving pre-registered request objects from an external location indicated by a URI, ensuring the request is complete and valid. It enables dynamic request objects, allowing authorization servers to fetch additional data required for processing the authorization request.

public class RequestUriFetcher : Abblix.Oidc.Server.Endpoints.Authorization.RequestFetching.IAuthorizationRequestFetcher

Inheritance System.Object → RequestUriFetcher

Implements IAuthorizationRequestFetcher

Constructors

RequestUriFetcher(ILogger<RequestUriFetcher>, IClientInfoProvider, ISecureHttpFetcher) Constructor

Handles fetching of authorization request objects from a specified request URI. This class is responsible for retrieving pre-registered request objects from an external location indicated by a URI, ensuring the request is complete and valid. It enables dynamic request objects, allowing authorization servers to fetch additional data required for processing the authorization request.

public RequestUriFetcher(Microsoft.Extensions.Logging.ILogger<Abblix.Oidc.Server.Endpoints.Authorization.RequestFetching.RequestUriFetcher> logger, Abblix.Oidc.Server.Features.ClientInformation.IClientInfoProvider clientInfoProvider, Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher secureHttpFetcher);

Parameters

logger Microsoft.Extensions.Logging.ILogger<RequestUriFetcher>

The logger used for logging warnings when request fetching fails.

clientInfoProvider IClientInfoProvider

Service to retrieve client-specific information for validation.

secureHttpFetcher ISecureHttpFetcher

The secure HTTP fetcher for retrieving content from external URIs with SSRF protection.

Methods

RequestUriFetcher.FetchAsync(AuthorizationRequest) Method

Asynchronously fetches the authorization request object from the given request URI. This method retrieves the request object if the request URI is valid and contains an absolute URL. It then returns the authorization request object or logs an error if the fetch fails.

public System.Threading.Tasks.Task<Abblix.Utils.Result<Abblix.Oidc.Server.Model.AuthorizationRequest,Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationRequestValidationError>> FetchAsync(Abblix.Oidc.Server.Model.AuthorizationRequest request);

Parameters

request AuthorizationRequest

The authorization request, which contains the RequestUri.

Implements FetchAsync(AuthorizationRequest)

Returns

System.Threading.Tasks.Task<Abblix.Utils.Result<AuthorizationRequest,AuthorizationRequestValidationError>>
A task representing the asynchronous operation, with the result being the fetched request object or an error.

Remarks

The method checks for conflicts between the `Request` and `RequestUri` parameters. If both are present, it returns an error since only one should be used. Otherwise, it proceeds to fetch the request object from the `RequestUri` and returns the result.