Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Symfony Oidc Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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

  • The package is glue code: a Symfony bundle wrapping jumbojett/OpenID-Connect-PHP, refactored into OOP services (OidcClientInterface, OidcUserProviderInterface, OidcUserData, OidcTokens) and wired into Symfony's authenticator manager and firewall.
  • The reusable layer is the OIDC protocol logic: discovery/.well-known parsing, JWKS retrieval and caching, token validation with configurable leeway, nonce verification, PKCE (S256/plain), userinfo retrieval, end-session support.
  • The non-reusable layer is everything a Laravel app would need to replace: Symfony DI extension/configuration tree, security.yaml firewall listener, LogoutEvent subscriber, Symfony Cache adapter, PropertyAccessor-based identifier extraction.
  • Net: ~30–40% of the codebase is directly portable; the rest must be reimplemented as a Laravel guard/middleware + service provider.

Integration feasibility

  • Do not install the bundle in a Laravel app. It hard-requires the Symfony new authenticator manager (Symfony 5.4+), 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.
  • Viable path: depend on 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.
  • PHP version alignment is good — PHP 8 requirement matches Laravel 9/10/11 baselines. No legacy-PHP tax.
  • Effort estimate: 2–4 engineer-weeks for a mid-level PHP developer to build and harden the adapter, plus a security review. A spike (3–5 days) should precede commitment.

Technical risk

  • High: no Laravel-native precedent. 99 stars, 0 dependents, single-vendor project auto-mirrored from a private GitLab. Effectively a thin community; you are on your own for integration issues.
  • Medium: upstream OIDC library health. The protocol engine is a third-party PHP library; its maintenance cadence, CVE responsiveness, and JWKS/JWT parsing behavior become your security posture. Verify it directly, not through the bundle.
  • Medium: IdP-specific quirks are real. Microsoft Entra ID "will not work with default configuration"; on-prem ADFS v1 needs an opt-in flag; only SURFconext is claimed as fully tested. Each target IdP needs an explicit conformance test on the roadmap.
  • Medium: security-sensitive surface. Nonce verification can be disabled (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.
  • Low: licensing. Apache-2.0, permissive, compatible with commercial use and forking.

Key questions for the spike / vendor review

  1. Which IdPs must we support at launch, and has each been tested against a real tenant (not just the README matrix)?
  2. Do we need multi-client support (multiple IdPs per app)? The bundle supports named clients — confirm our adapter needs it.
  3. What is the user provisioning contract on first login (JIT create vs. pre-provisioned), and which claim is the stable identifier (sub vs. email)?
  4. Is id_token-only operation (no userinfo call) acceptable for latency, or do we need profile enrichment?
  5. Do we need true IdP-side logout, and what is the product's stated expectation when a user "logs out"?
  6. Who owns security patching of the adapter internally, and what is the SLA?

Integration Approach

Stack fit

  • Laravel replaces the two integration points the bundle exists to provide: (a) the Symfony firewall authenticator → Laravel auth guard + auth middleware; (b) the Symfony user provider → Eloquent-backed UserProvider. Everything else (state/nonce handling, PKCE, token exchange, claim mapping) is portable.
  • Cache: the bundle uses 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: the bundle's YAML client block maps naturally to config/oidc.php with an env()-driven client array, giving us the same multi-client autowiring semantics without Symfony DI.

Migration path

  1. Extract, don't adopt. Create an internal package 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.
  2. Implement the Laravel seam: service provider (config publish + singleton binding), guard, user provider, redirect controller, callback route, logout listener on Laravel's Logout event.
  3. Map the configuration surface the bundle already documents — 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.
  4. Preserve the 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

  • Target PHP 8.1+ and the Laravel versions currently in support; no Symfony security dependency.
  • Verify the chosen OIDC library against our pinned firebase/php-jwt or equivalent transitive dependency to avoid a duplicate-JWT-parser conflict.
  • Treat the bundle's Symfony version constraints (5.4/6+) as an irrelevant-but-blocking signal: it confirms the package will never track Laravel's release cadence, so any direct dependency is a dead end.

Sequencing

  • Phase 0 (week 1): spike — authenticate against the primary IdP with a throwaway adapter; validate discovery, JWKS rotation, nonce, PKCE, and claim mapping. Exit criteria: one real login and one token-refresh/expiry case pass.
  • Phase 1 (weeks 2–3): internal package, config, guard, user provider, provisioning policy.
  • Phase 2 (week 4): remember-me, logout/end-session, failure paths, and a per-IdP conformance checklist (Entra ID and ADFS configurations adapted from the bundle's docs).
  • Phase 3: security review, threat model on token validation, load test on callback path, then rollout behind a feature flag.
  • Defer: multi-client support and end-session logout unless the product explicitly requires them.

Operational Impact

Maintenance

  • Ongoing cost is internal ownership of a forked auth library: periodic upstream diffing against 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.
  • The mirrored-repository model (development on a private GitLab, issues accepted on GitHub) means upstream responsiveness is unpredictable. Do not assume a fix lands on our timeline.

Support

  • No commercial support, no vendor SLA, no published security policy visible in the docs. Escalation is "open a GitHub issue." For an authentication-critical dependency this is the single biggest operational gap and must be accepted explicitly by the TPM, not discovered later.
  • Mitigation: keep the fork shallow, keep a named internal owner, and maintain our own test harness per IdP so we can patch without upstream.

Scaling

  • The design is stateless per request except for session and cache. Steady-state cost is one token exchange and one userinfo call per login — negligible volume for typical B2B/B2C login rates.
  • Real scaling concerns are outbound latency to the IdP (discovery, userinfo) and cache stampede on JWKS refresh. Enforce HTTP timeouts and use Laravel's atomic locks on cache warm.
  • Horizontal scaling is fine; ensure the cache store is shared (Redis), not array/file, so JWKS and well-known documents don't fan out per node.

Failure modes to design and alert on

  • IdP discovery endpoint unreachable or slow → login blocked for all users; needs a circuit breaker and a clear error page.
  • JWKS key rotation not picked up within cache TTL → intermittent signature validation failures; shorten TTL or force refresh on failure.
  • Clock skew between app and IdP exceeding 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.
  • Nonce/state mismatch from stale sessions or multi-tab logins → user-facing "login failed"; add an explicit, non-alarming error path.
  • Misconfiguration of disable_nonce or over-broad leeway → silent weakening of validation. Gate these behind code review and a config schema test.
  • Logout expectation gap: users who "log out" remain authenticated at the IdP. Product must decide the message; do not enable end-session by default.

Ramp-up

  • The learning curve is OIDC/OAuth2 correctness, not this package. Any engineer who can read the README can implement the Symfony side in a day; getting PKCE, nonce, token validation, and claim mapping right takes longer.
  • Estimate 1–2 weeks for a capable Laravel engineer to be productive on the adapter, plus a security reviewer's time. The bundle's documentation is genuinely good — the IdP-specific notes (Entra ID, ADFS) are the highest-value artifact and should be copied into our internal runbook as-is.
  • Onboarding risk is concentrated, not distributed: two people should own this, not one, precisely because upstream gives us no safety net.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log