Skip to content

TokenResponseFormatter Class

Formats token endpoint results as Microsoft.AspNetCore.Http.IResult: a JSON token response on success, or the RFC-compliant OAuth error (status, JSON envelope, WWW-Authenticate challenge, DPoP-Nonce) on failure.

C#
public class TokenResponseFormatter : Abblix.Oidc.Server.MinimalApi.Formatters.Interfaces.ITokenResponseFormatter

Inheritance System.Object → TokenResponseFormatter

Implements ITokenResponseFormatter

Constructors

TokenResponseFormatter(IIssuerProvider) Constructor

Formats token endpoint results as Microsoft.AspNetCore.Http.IResult: a JSON token response on success, or the RFC-compliant OAuth error (status, JSON envelope, WWW-Authenticate challenge, DPoP-Nonce) on failure.

C#
public TokenResponseFormatter(Abblix.Oidc.Server.Features.Issuer.IIssuerProvider issuerProvider);

Parameters

issuerProvider IIssuerProvider

Supplies the issuer used as the realm on client-authentication challenges.

Methods

TokenResponseFormatter.FormatResponseAsync(TokenRequest, Result<TokenIssued,OidcError>) Method

Formats the token endpoint result.

C#
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Http.IResult> FormatResponseAsync(Abblix.Oidc.Server.Model.TokenRequest request, Abblix.Utils.Result<Abblix.Oidc.Server.Endpoints.Token.Interfaces.TokenIssued,Abblix.Oidc.Server.Common.OidcError> response);

Parameters

request TokenRequest

The core token request being answered.

response Abblix.Utils.Result<TokenIssued,OidcError>

The success-or-error result produced by the token handler.

Implements FormatResponseAsync(TokenRequest, Result<TokenIssued,OidcError>)

Returns

System.Threading.Tasks.Task<Microsoft.AspNetCore.Http.IResult>
An Microsoft.AspNetCore.Http.IResult carrying the token response or the formatted error.