#### [Abblix\.Oidc\.Server](https://www.abblix.com/en/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Endpoints\.Token\.Grants](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Grants '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\.

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

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

Implements [IAuthorizationGrantHandler](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Grants.IAuthorizationGrantHandler 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Grants\.IAuthorizationGrantHandler'), [IGrantTypeInformer](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Interfaces.IGrantTypeInformer 'Abblix\.Oidc\.Server\.Common\.Interfaces\.IGrantTypeInformer')
### Constructors

## CompositeAuthorizationGrantHandler\(IEnumerable\<IAuthorizationGrantHandler\>\) Constructor {#Abblix.Oidc.Server.Endpoints.Token.Grants.CompositeAuthorizationGrantHandler.CompositeAuthorizationGrantHandler(System.Collections.Generic.IEnumerable_Abblix.Oidc.Server.Endpoints.Token.Grants.IAuthorizationGrantHandler_)}

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\.

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

###### `grantHandlers` [System\.Collections\.Generic\.IEnumerable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')[IAuthorizationGrantHandler](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Grants.IAuthorizationGrantHandler 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Grants\.IAuthorizationGrantHandler')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1') {#Abblix.Oidc.Server.Endpoints.Token.Grants.CompositeAuthorizationGrantHandler.CompositeAuthorizationGrantHandler(System.Collections.Generic.IEnumerable_Abblix.Oidc.Server.Endpoints.Token.Grants.IAuthorizationGrantHandler_).grantHandlers}

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

## CompositeAuthorizationGrantHandler\.GrantTypesSupported Property {#Abblix.Oidc.Server.Endpoints.Token.Grants.CompositeAuthorizationGrantHandler.GrantTypesSupported}

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\.

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

Implements [GrantTypesSupported](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Interfaces.IGrantTypeInformer#Abblix.Oidc.Server.Common.Interfaces.IGrantTypeInformer.GrantTypesSupported 'Abblix\.Oidc\.Server\.Common\.Interfaces\.IGrantTypeInformer\.GrantTypesSupported')

#### Property Value
[System\.Collections\.Generic\.IEnumerable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')
### Methods

## CompositeAuthorizationGrantHandler\.AuthorizeAsync\(TokenRequest, ClientInfo\) Method {#Abblix.Oidc.Server.Endpoints.Token.Grants.CompositeAuthorizationGrantHandler.AuthorizeAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo)}

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\.

```csharp
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](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Model.TokenRequest 'Abblix\.Oidc\.Server\.Model\.TokenRequest') {#Abblix.Oidc.Server.Endpoints.Token.Grants.CompositeAuthorizationGrantHandler.AuthorizeAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).request}

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

###### `clientInfo` [ClientInfo](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientInformation.ClientInfo 'Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo') {#Abblix.Oidc.Server.Endpoints.Token.Grants.CompositeAuthorizationGrantHandler.AuthorizeAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).clientInfo}

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

Implements [AuthorizeAsync\(TokenRequest, ClientInfo\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Grants.IAuthorizationGrantHandler#Abblix.Oidc.Server.Endpoints.Token.Grants.IAuthorizationGrantHandler.AuthorizeAsync(Abblix.Oidc.Server.Model.TokenRequest,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo) 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Grants\.IAuthorizationGrantHandler\.AuthorizeAsync\(Abblix\.Oidc\.Server\.Model\.TokenRequest, Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Abblix\.Utils\.Result&lt;](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[AuthorizedGrant](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Interfaces\.AuthorizedGrant')[,](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[&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 result of the authorization process\.
            If successful, it contains the granted authorization;
            otherwise, it contains an error explaining why the authorization failed\.
