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.
Synopsis
Section titled “Synopsis”interface UserProviderInterface
| Implemented by | CallableUserProvider, InMemoryUserProvider, PdoUserProvider |
| Since | 1.0.0 |
| Source | Security/Auth/UserProviderInterface.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
loadByIdentifier(string $identifier): ?UserIdentity | |
loadByToken(TokenClaims $claims): ?UserIdentity | Maps validated token claims (e.g. |
loadByIdentifier()
Section titled “loadByIdentifier()”abstract public function loadByIdentifier(string $identifier): ?UserIdentity
E.g. an email or username.
| Parameter | Type | Description |
|---|---|---|
$identifier | string | E.g. an email or username. |
Returns ?UserIdentity — Null if no matching identity exists.
loadByToken()
Section titled “loadByToken()”abstract public function loadByToken(TokenClaims $claims): ?UserIdentity
Maps validated token claims (e.g.
The validated token claims (see TokenValidatorInterface).
| Parameter | Type | Description |
|---|---|---|
$claims | TokenClaims | The validated token claims (see TokenValidatorInterface). |
Returns ?UserIdentity — Null if the claims don’t resolve to a known identity.