Skip to content

UserProviderInterface

Loads a UserIdentity either by a stable identifier (form login, HTTP Basic) or from validated token claims (bearer/JWT/OIDC).

Backends: an in-memory config-driven provider, a PDO-backed provider reusing DatabaseManager, or a callable-based provider for app-custom lookups.

interface UserProviderInterface

Implemented byCallableUserProvider, InMemoryUserProvider, PdoUserProvider
Since1.0.0
SourceSecurity/Auth/UserProviderInterface.php
MethodDescription
loadByIdentifier(string $identifier): ?UserIdentity
loadByToken(TokenClaims $claims): ?UserIdentityMaps validated token claims (e.g.

abstract public function loadByIdentifier(string $identifier): ?UserIdentity

E.g. an email or username.

ParameterTypeDescription
$identifierstringE.g. an email or username.

Returns ?UserIdentity — Null if no matching identity exists.

abstract public function loadByToken(TokenClaims $claims): ?UserIdentity

Maps validated token claims (e.g.

The validated token claims (see TokenValidatorInterface).

ParameterTypeDescription
$claimsTokenClaimsThe validated token claims (see TokenValidatorInterface).

Returns ?UserIdentity — Null if the claims don’t resolve to a known identity.