OidcLoginOutcome
in package
FinalYes
What a login/callback handler should do next — one shape per outcome kind. Framework controllers ({@see \Axiam\Sdk\Laravel\OidcLoginController}/`OidcCallbackController`, {@see \Axiam\Sdk\Symfony\OidcLoginController}/`OidcCallbackController`) translate this into their own framework's redirect/JSON response and add nothing of their own, so Laravel and Symfony cannot drift (mirrors the TypeScript reference's `OidcLoginOutcome` discriminated union).
Table of Contents
Constants
- KIND_ERROR : mixed = 'error'
- KIND_JSON : mixed = 'json'
- KIND_REDIRECT : mixed = 'redirect'
Properties
- $authenticated : bool|null
- $error : string|null
- $expiresIn : int|null
- $kind : string
- $message : string|null
- $redirectUrl : string|null
- $status : int|null
- $sub : string|null
Methods
- error() : self
- Reply `$status` with the standardized `{error, message}` body (§10/§11 shape).
- errorBody() : array{error: string, message: string}
- json() : self
- Reply `200` with a token-free login summary — the fallback when no post-login redirect is configured.
- jsonBody() : array{authenticated: true, sub?: string, expiresIn: int}
- redirect() : self
- Send a 302 to `$url` — the IdP authorization URL, or the post-login destination.
Constants
KIND_ERROR
public
mixed
KIND_ERROR
= 'error'
KIND_JSON
public
mixed
KIND_JSON
= 'json'
KIND_REDIRECT
public
mixed
KIND_REDIRECT
= 'redirect'
Properties
$authenticated read-only
public
bool|null
$authenticated
= null
$error read-only
public
string|null
$error
= null
$expiresIn read-only
public
int|null
$expiresIn
= null
$kind read-only
public
string
$kind
$message read-only
public
string|null
$message
= null
$redirectUrl read-only
public
string|null
$redirectUrl
= null
$status read-only
public
int|null
$status
= null
$sub read-only
public
string|null
$sub
= null
Methods
error()
Reply `$status` with the standardized `{error, message}` body (§10/§11 shape).
public
static error(int $status, string $error, string $message) : self
Parameters
- $status : int
- $error : string
- $message : string
Return values
selferrorBody()
public
errorBody() : array{error: string, message: string}
Return values
array{error: string, message: string}json()
Reply `200` with a token-free login summary — the fallback when no post-login redirect is configured.
public
static json(string|null $sub, int $expiresIn) : self
Parameters
- $sub : string|null
- $expiresIn : int
Return values
selfjsonBody()
public
jsonBody() : array{authenticated: true, sub?: string, expiresIn: int}
Return values
array{authenticated: true, sub?: string, expiresIn: int}redirect()
Send a 302 to `$url` — the IdP authorization URL, or the post-login destination.
public
static redirect(string $url) : self
Parameters
- $url : string