drenso/symfony-oidc-bundle
Symfony OIDC bundle adds OpenID Connect authentication to Symfony applications using the new authentication manager. Supports SURFconext/OpenConext, Keycloak, Auth0, Microsoft Entra ID and others. Requires Symfony 5.4+ and PHP 8.
Bottom line: this is a well-documented, competently built Symfony bundle, not a Laravel package. Its value to a Laravel roadmap is as a reference implementation and a vendorable OIDC library, not as a composer require. Recommend a spike to extract the framework-agnostic core rather than adopt the bundle.
Architecture fit
jumbojett/OpenID-Connect-PHP, refactored into OOP services (OidcClientInterface, OidcUserProviderInterface, OidcUserData, OidcTokens) and wired into Symfony's authenticator manager and firewall..well-known parsing, JWKS retrieval and caching, token validation with configurable leeway, nonce verification, PKCE (S256/plain), userinfo retrieval, end-session support.security.yaml firewall listener, LogoutEvent subscriber, Symfony Cache adapter, PropertyAccessor-based identifier extraction.Integration feasibility
symfony/security-bundle, and PHP 8. Pulling symfony/security-bundle into Laravel is dead weight and a live conflict surface against Laravel's own pinned Symfony components.jumbojett/OpenID-Connect-PHP directly (Apache-licensed dependency of this package) or vendor the Drenso OOP wrapper as an internal acme/laravel-oidc package, then implement: a OidcGuard/OidcUserProvider (Laravel's Illuminate\Contracts\Auth\UserProvider), a login redirect controller, and a login-callback route acting as check_path.Technical risk
disable_nonce), token_leeway_seconds defaults to 300, and logout is disabled by default for good reason (SSO logout cannot guarantee IdP-side logout). Misconfiguration here is an auth bypass, not a bug.Key questions for the spike / vendor review
sub vs. email)?id_token-only operation (no userinfo call) acceptable for latency, or do we need profile enrichment?Stack fit
auth middleware; (b) the Symfony user provider → Eloquent-backed UserProvider. Everything else (state/nonce handling, PKCE, token exchange, claim mapping) is portable.symfony/cache for well-known and JWKS caching. Map to Laravel's cache repository (Cache::remember with TTLs of 3600s as the documented default) — this is a clean one-to-one substitution.config/oidc.php with an env()-driven client array, giving us the same multi-client autowiring semantics without Symfony DI.Migration path
acme/laravel-oidc that vendors/forks the OOP OIDC core (client, well-known parser, token validator, data/token value objects) with attribution to Apache-2.0 upstream.Logout event.well_known_url, client_id, client_secret, redirect_route, code_challenge_method, token_leeway_seconds, disable_nonce, cache TTLs — into config/oidc.php. Do not invent new knobs; the existing ones encode hard-won operational knowledge.ensureUserExists / loadOidcUser split. It is the bundle's best design idea: it separates JIT provisioning from login lookup and lets the caller tell OIDC logins apart from password logins. Port it verbatim into the user provider contract.Compatibility
firebase/php-jwt or equivalent transitive dependency to avoid a duplicate-JWT-parser conflict.Sequencing
Maintenance
jumbojett/OpenID-Connect-PHP and this bundle (the Drenso fork contains real fixes worth tracking), plus PHP/Laravel upgrade work. Budget ~1–2 engineer-days per quarter steady state, spiking during CVE events.Support
Scaling
array/file, so JWKS and well-known documents don't fan out per node.Failure modes to design and alert on
token_leeway_seconds → intermittent token rejection; monitor and document the setting rather than silently widening it.redirect_uri mismatch after a deploy or domain change → IdP-side rejection with an opaque error; pin and test the callback route.disable_nonce or over-broad leeway → silent weakening of validation. Gate these behind code review and a config schema test.Ramp-up
How can I help you explore Laravel packages today?