Skip to main content

CompositeAuthorizationGrantHandler Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Endpoints.Token.Grants

CompositeAuthorizationGrantHandler Class

A composite handler that coordinates multiple authorization grant handlers for processing OAuth 2.0 token requests. This class allows for flexible and extensible handling of various grant types by delegating specific grant processing tasks to individual handlers. It dynamically aggregates all available grant handlers, facilitating the addition of new handlers without modifying the core authorization flow.

public class CompositeAuthorizationGrantHandler : Abblix.Oidc.Server.Endpoints.Token.Grants.IAuthorizationGrantHandler, Abblix.Oidc.Server.Common.Interfaces.IGrantTypeInformer

Inheritance System.Object → CompositeAuthorizationGrantHandler

Implements IAuthorizationGrantHandler, IGrantTypeInformer

Constructors

CompositeAuthorizationGrantHandler(IEnumerable<IAuthorizationGrantHandler>) Constructor

A composite handler that coordinates multiple authorization grant handlers for processing OAuth 2.0 token requests. This class allows for flexible and extensible handling of various grant types by delegating specific grant processing tasks to individual handlers. It dynamically aggregates all available grant handlers, facilitating the addition of new handlers without modifying the core authorization flow.

public CompositeAuthorizationGrantHandler(System.Collections.Generic.IEnumerable<Abblix.Oidc.Server.Endpoints.Token.Grants.IAuthorizationGrantHandler> grantHandlers);

Parameters

grantHandlers System.Collections.Generic.IEnumerable<IAuthorizationGrantHandler>

A collection of grant handlers, each responsible for a specific set of grant types.

Properties

CompositeAuthorizationGrantHandler.GrantTypesSupported Property

Provides a list of all the supported grant types across the registered grant handlers. This allows the composite handler to advertise the full set of supported grant types, which can be used for validation and discovery of capabilities by client applications.

public System.Collections.Generic.IEnumerable<string> GrantTypesSupported { get; }

Implements GrantTypesSupported

Property Value

System.Collections.Generic.IEnumerable<System.String>

Methods

CompositeAuthorizationGrantHandler.AuthorizeAsync(TokenRequest, ClientInfo) Method

Processes a token request asynchronously by delegating the request to the appropriate handler based on the grant type. If a handler for the requested grant type is found, it delegates the request to that handler for processing. Otherwise, it returns an error indicating that the grant type is not supported. This method abstracts away the complexity of identifying and invoking the correct handler, simplifying the main authorization flow.

public System.Threading.Tasks.Task<Abblix.Utils.Result<Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant,Abblix.Oidc.Server.Common.OidcError>> AuthorizeAsync(Abblix.Oidc.Server.Model.TokenRequest request, Abblix.Oidc.Server.Features.ClientInformation.ClientInfo clientInfo);

Parameters

request TokenRequest

The token request, which includes the grant type and relevant parameters for processing the request.

clientInfo ClientInfo

The client information used to validate and process the request, ensuring the request is authorized.

Implements AuthorizeAsync(TokenRequest, ClientInfo)

Returns

System.Threading.Tasks.Task<Abblix.Utils.Result<AuthorizedGrant,OidcError>>
A task that resolves to the result of the authorization process. If successful, it contains the granted authorization; otherwise, it contains an error explaining why the authorization failed.