Skip to content

AuthorizationResponseFormatter Class

Handles the formatting of authorization responses in compliance with OpenID Connect and OAuth 2.0 protocols. Protocol-level decisions (parameter assembly, iss/scope gating, JARM packing) are made upstream by the core response encoder; this formatter maps the encoded response onto the MVC wire DTO and delivers it to the client's redirect URI via query, fragment or form_post - for both successful and error responses.

C#
public class AuthorizationResponseFormatter : Abblix.Oidc.Server.Mvc.Formatters.Interfaces.IAuthorizationResponseFormatter

Inheritance System.Object → AuthorizationResponseFormatter

Implements IAuthorizationResponseFormatter

Constructors

AuthorizationResponseFormatter(IOptions<OidcOptions>, IAuthorizationRequestStorage, ISessionManagementService, IUriResolver, IParametersProvider) Constructor

Handles the formatting of authorization responses in compliance with OpenID Connect and OAuth 2.0 protocols. Protocol-level decisions (parameter assembly, iss/scope gating, JARM packing) are made upstream by the core response encoder; this formatter maps the encoded response onto the MVC wire DTO and delivers it to the client's redirect URI via query, fragment or form_post - for both successful and error responses.

C#
public AuthorizationResponseFormatter(Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Common.Configuration.OidcOptions> options, Abblix.Oidc.Server.Features.Storages.IAuthorizationRequestStorage authorizationRequestStorage, Abblix.Oidc.Server.Features.SessionManagement.ISessionManagementService sessionManagementService, Abblix.Oidc.Server.Mvc.IUriResolver uriResolver, Abblix.Oidc.Server.Common.Interfaces.IParametersProvider parametersProvider);

Parameters

options Microsoft.Extensions.Options.IOptions<OidcOptions>

Provides the configured interaction URIs (login, consent, ...) and request-uri parameter name used when redirecting the user agent to the authorization server's own UI.

authorizationRequestStorage IAuthorizationRequestStorage

Stores the pending authorization request when redirecting to an interaction page, returning the request_uri that links back to it.

sessionManagementService ISessionManagementService

Supplies the OIDC Session Management cookie appended to a successful authentication response.

uriResolver IUriResolver

Resolves relative interaction URIs to absolute ones for redirection.

parametersProvider IParametersProvider

Flattens the MVC wire DTO into name/value pairs for delivery.

Methods

AuthorizationResponseFormatter.FormatResponseAsync(AuthorizationRequest, AuthorizationResponse) Method

Formats an authorization response based on the specified request and response model asynchronously. It handles various outcomes such as redirections for additional user interactions and successful authentication, adapting the response according to the OpenID Connect and OAuth 2.0 specifications.

C#
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult> FormatResponseAsync(Abblix.Oidc.Server.Model.AuthorizationRequest request, Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationResponse response);

Parameters

request AuthorizationRequest

The authorization request containing details about the initial request from the client.

response AuthorizationResponse

The authorization response model to format.

Implements FormatResponseAsync(AuthorizationRequest, AuthorizationResponse)

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
A task that returns an Microsoft.AspNetCore.Mvc.ActionResult that can be returned by an ASP.NET Core controller.