Skip to content

Passport

The resolved outcome of a successful AuthenticatorInterface::authenticate() call: the identity plus the credentials/roles to grant, and whether the identity is stateless (re-derived from the credential every request rather than read back from the session).

Consumed by Quiote\Security\Auth\AuthenticationManager (packages/auth) to populate a SecurityUser/RbacSecurityUser.

final class Passport

Since1.0.0
SourceSecurity/Auth/Passport.php

public function __construct(UserIdentity $identity, array<int, string> $credentials = [], bool $stateless = false, ?TokenClaims $claims = null): mixed

The token this passport was derived from, if any (see getClaims()).

ParameterTypeDescription
$identityUserIdentityThe resolved identity.
$credentialsarray``<``int``, ``string``>Roles/permissions to grant on the SecurityUser.
$statelessboolTrue if the identity is re-derived from the credential every request.
$claims?TokenClaimsThe token this passport was derived from, if any (see getClaims()).

Returns mixed

MethodDescription
getClaims(): ?TokenClaimsThe token claims this passport was derived from, if the authenticator that produced it was token-based (bearer/JWT/OIDC).
getCredentials(): array<int, string>
getIdentity(): UserIdentity
isStateless(): bool

public function getClaims(): ?TokenClaims

The token claims this passport was derived from, if the authenticator that produced it was token-based (bearer/JWT/OIDC).

Returns ?TokenClaims — The token claims, or null for a non-token authenticator (form login, HTTP Basic).

public function getCredentials(): array<int, string>

Returns array``<``int``, ``string``> — Roles/permissions to grant on the SecurityUser.

public function getIdentity(): UserIdentity

Returns UserIdentity — The identity resolved by the authenticator.

public function isStateless(): bool

Returns bool — True if the identity is re-derived from the credential every request, otherwise false.