Skip to main content

AuthorizationCodeBuilder Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Endpoints.Authorization

AuthorizationCodeBuilder Class

Builds the code response-type component of an authorization endpoint success response — the Authorization Code Flow contributor. Generates an authorization code via IAuthorizationCodeService and stores it on the running SuccessfullyAuthenticated result. Registered by default through AddAuthorizationEndpoint(); covers the OAuth 2.1 (draft) recommended flow. Declares authorization_code in GrantTypesSupported so the discovery endpoint and registration-time gates aggregate it transparently.

public class AuthorizationCodeBuilder : Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.IAuthorizationResponseBuilder, Abblix.Oidc.Server.Common.Interfaces.IGrantTypeInformer

Inheritance System.Object → AuthorizationCodeBuilder

Implements IAuthorizationResponseBuilder, IGrantTypeInformer

Constructors

AuthorizationCodeBuilder(IAuthorizationCodeService, IAuthorizationValueReuseDetector) Constructor

Builds the code response-type component of an authorization endpoint success response — the Authorization Code Flow contributor. Generates an authorization code via IAuthorizationCodeService and stores it on the running SuccessfullyAuthenticated result. Registered by default through AddAuthorizationEndpoint(); covers the OAuth 2.1 (draft) recommended flow. Declares authorization_code in GrantTypesSupported so the discovery endpoint and registration-time gates aggregate it transparently.

public AuthorizationCodeBuilder(Abblix.Oidc.Server.Features.Storages.IAuthorizationCodeService authorizationCodeService, Abblix.Oidc.Server.Features.ReusePrevention.IAuthorizationValueReuseDetector reuseDetector);

Parameters

authorizationCodeService IAuthorizationCodeService
reuseDetector IAuthorizationValueReuseDetector

Properties

AuthorizationCodeBuilder.GrantTypesSupported Property

The grant types supported by this component, as defined in OAuth 2.0 and OpenID Connect specifications.

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

Implements GrantTypesSupported

Property Value

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

Remarks

Common grant types include:

  • "authorization_code" - Authorization Code Grant
  • "implicit" - Implicit Grant
  • "refresh_token" - Refresh Token Grant
  • "client_credentials" - Client Credentials Grant
  • "password" - Resource Owner Password Credentials Grant

AuthorizationCodeBuilder.ResponseType Property

The single OAuth 2.0 / OIDC response-type value this processor is responsible for, matched case-sensitively against parts of the request's response_type.

public string ResponseType { get; }

Implements ResponseType

Property Value

System.String

Methods

AuthorizationCodeBuilder.BuildResponseAsync(ValidAuthorizationRequest, AuthorizedGrant, SuccessfullyAuthenticated) Method

Populates the relevant field on result for this processor's response type. Implementations mutate result in place and may read fields populated by processors that ran earlier in the canonical iteration order (code before token before id_token).

public System.Threading.Tasks.Task BuildResponseAsync(Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.ValidAuthorizationRequest request, Abblix.Oidc.Server.Endpoints.Token.Interfaces.AuthorizedGrant authorizedGrant, Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.SuccessfullyAuthenticated result);

Parameters

request ValidAuthorizationRequest
authorizedGrant AuthorizedGrant
result SuccessfullyAuthenticated

Implements BuildResponseAsync(ValidAuthorizationRequest, AuthorizedGrant, SuccessfullyAuthenticated)

Returns

System.Threading.Tasks.Task