Table of Contents

Class OidcCallbackCommandHandler

Namespace
SEBT.Portal.UseCases.Auth.OidcCallback
Assembly
SEBT.Portal.UseCases.dll

Orchestrates the server-side OIDC callback. Validates state against the stored pre-auth session value, uses the stored code_verifier for the token exchange (never from the browser), and advances the session to CallbackCompleted. The stateCode and isStepUp values are read from the session — the command only carries code, state, and the session id.

Failure log entries derive their HttpStatus from OidcResultHttpStatus — the same table the API layer maps responses from — so the logged status is always the returned status.

public class OidcCallbackCommandHandler : ICommandHandler<OidcCallbackCommand, OidcCallbackResponse>
Inheritance
object
OidcCallbackCommandHandler
Implements

Constructors

OidcCallbackCommandHandler(IPreAuthSessionStore, IOidcExchangeService, IOidcCallbackFailureLogger, ILogger<OidcCallbackCommandHandler>)

Orchestrates the server-side OIDC callback. Validates state against the stored pre-auth session value, uses the stored code_verifier for the token exchange (never from the browser), and advances the session to CallbackCompleted. The stateCode and isStepUp values are read from the session — the command only carries code, state, and the session id.

Failure log entries derive their HttpStatus from OidcResultHttpStatus — the same table the API layer maps responses from — so the logged status is always the returned status.

public OidcCallbackCommandHandler(IPreAuthSessionStore sessionStore, IOidcExchangeService exchangeService, IOidcCallbackFailureLogger callbackFailureLogger, ILogger<OidcCallbackCommandHandler> logger)

Parameters

sessionStore IPreAuthSessionStore
exchangeService IOidcExchangeService
callbackFailureLogger IOidcCallbackFailureLogger
logger ILogger<OidcCallbackCommandHandler>

Methods

Handle(OidcCallbackCommand, CancellationToken)

public Task<Result<OidcCallbackResponse>> Handle(OidcCallbackCommand command, CancellationToken cancellationToken = default)

Parameters

command OidcCallbackCommand
cancellationToken CancellationToken

Returns

Task<Result<OidcCallbackResponse>>