Skip to content

ClientManagementController Class

The ClientManagementController is responsible for handling client-related operations in the context of OAuth 2.0 and OpenID Connect. This includes dynamic client registration, reading client configurations, and deleting registered clients.

C#
public class ClientManagementController : Microsoft.AspNetCore.Mvc.ControllerBase

Inheritance System.ObjectMicrosoft.AspNetCore.Mvc.ControllerBase → ClientManagementController

Remarks

The controller adheres to the OpenID Connect Dynamic Client Registration protocol, allowing clients to register themselves dynamically with the authorization server. It supports operations like registering new clients, querying existing client configurations, and removing clients. This is crucial for systems where client applications need to be managed programmatically without manual intervention. For detailed protocol specifications, refer to https://openid.net/specs/openid-connect-registration-1_0.html.

Methods

ClientManagementController.ReadClientAsync(IReadClientHandler, IReadClientResponseFormatter, ClientAuthorizationRequest) Method

Retrieves the configuration of a previously registered client from the authorization server.

C#
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult> ReadClientAsync(Abblix.Oidc.Server.Endpoints.DynamicClientManagement.Interfaces.IReadClientHandler handler, Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IReadClientResponseFormatter formatter, Abblix.Oidc.Server.Mvc.Model.ClientAuthorizationRequest authorizationRequest);

Parameters

handler IReadClientHandler

The handler responsible for processing client information requests.

formatter IReadClientResponseFormatter

The formatter responsible for generating the client information response.

authorizationRequest ClientAuthorizationRequest

The client authorization request containing client_id and registration_access_token.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
A task that returns an action result that includes the client information response.

Remarks

This method allows clients to query their current configuration stored by the authorization server. Per RFC 7592 Section 2.1, the endpoint URL format is /connect/register/{client_id}. The registration_access_token is passed via Authorization: Bearer header.

ClientManagementController.RegisterClientAsync(IRegisterClientHandler, IRegisterClientResponseFormatter, ClientRegistrationRequest, AuthenticationHeaderValue) Method

Registers a new client dynamically with the authorization server. This endpoint processes the client registration requests by validating the provided details and creating a new client configuration.

C#
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult> RegisterClientAsync(Abblix.Oidc.Server.Endpoints.DynamicClientManagement.Interfaces.IRegisterClientHandler handler, Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IRegisterClientResponseFormatter formatter, Abblix.Oidc.Server.Model.ClientRegistrationRequest request, System.Net.Http.Headers.AuthenticationHeaderValue? authorizationHeader);

Parameters

handler IRegisterClientHandler

The handler responsible for processing client registration requests.

formatter IRegisterClientResponseFormatter

The formatter responsible for generating the client registration response.

request ClientRegistrationRequest

The details of the client registration request.

authorizationHeader System.Net.Http.Headers.AuthenticationHeaderValue

The optional initial access token from the Authorization header, used to authenticate the registration request per RFC 7591 Section 3.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
A task that returns an action result that includes the client registration response.

Remarks

This method implements the OpenID Connect Dynamic Client Registration protocol, facilitating clients to register dynamically. It validates the request, processes it if valid, and formats a response that can include either the successful registration details or an error message.

ClientManagementController.RemoveClientAsync(IRemoveClientHandler, IRemoveClientResponseFormatter, ClientAuthorizationRequest) Method

Removes a registered client's configuration from the authorization server, effectively revoking its registration and access.

C#
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult> RemoveClientAsync(Abblix.Oidc.Server.Endpoints.DynamicClientManagement.Interfaces.IRemoveClientHandler handler, Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IRemoveClientResponseFormatter formatter, Abblix.Oidc.Server.Mvc.Model.ClientAuthorizationRequest authorizationRequest);

Parameters

handler IRemoveClientHandler

The handler responsible for processing client removal requests.

formatter IRemoveClientResponseFormatter

The formatter responsible for generating the client removal response.

authorizationRequest ClientAuthorizationRequest

The client authorization request containing client_id and registration_access_token.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
A task that returns an action result that confirms the client removal.

Remarks

This method supports the removal of clients from the authorization server per RFC 7592 Section 2.3. Per RFC 7592, the endpoint URL format is /connect/register/{client_id}. The registration_access_token is passed via Authorization: Bearer header.

ClientManagementController.UpdateClientAsync(IUpdateClientHandler, IUpdateClientResponseFormatter, ClientAuthorizationRequest, ClientRegistrationRequest) Method

Updates a registered client's configuration with new metadata per RFC 7592 Section 2.2.

C#
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult> UpdateClientAsync(Abblix.Oidc.Server.Endpoints.DynamicClientManagement.Interfaces.IUpdateClientHandler handler, Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IUpdateClientResponseFormatter formatter, Abblix.Oidc.Server.Mvc.Model.ClientAuthorizationRequest authorizationRequest, Abblix.Oidc.Server.Model.ClientRegistrationRequest registrationRequest);

Parameters

handler IUpdateClientHandler

The handler responsible for processing client update requests.

formatter IUpdateClientResponseFormatter

The formatter responsible for generating the client update response.

authorizationRequest ClientAuthorizationRequest

The client authorization request containing client_id and registration_access_token.

registrationRequest ClientRegistrationRequest

The updated client metadata from request body.

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
A task that returns an action result with the updated client configuration.

Remarks

This method implements RFC 7592 OAuth 2.0 Dynamic Client Registration Management Protocol Section 2.2. Per RFC 7592, the endpoint URL format is /connect/register/{client_id}. The registration_access_token is passed via Authorization: Bearer header. The request body must contain all client metadata including the client_id and client_secret. Returns 200 OK with updated configuration on success.