ronvanderheijden/openid-connect
OpenID Connect authentication for Laravel. Add OIDC login to your app with discovery, authorization code flow, token handling, and user info support.
Architecture fit
ronvanderheijden/openid-connect is a Laravel-native package that layers OpenID Connect provider capabilities onto an existing Laravel application — discovery document (/.well-known/openid-configuration), JWKS exposure, and the surrounding token/claim plumbing. Architecturally it sits as a thin HTTP + crypto adapter over the app's existing user model and auth guard, which is a good fit if the intent is to make a first-party Laravel app the identity provider (IdP) for sibling services. It is a poor fit if the requirement is to consume a third-party IdP (that is Socialite territory) or if the IdP must be a standalone, horizontally scaled service independent of the Laravel app lifecycle.
Integration feasibility
High. The package is Composer-installable, publishes config/routes, and the surface area a TPM needs to sequence is small: config publish, route registration, key material generation, and claim mapping to the User model. The 1.2.1 fix is illustrative of the integration surface — scopes_supported in the discovery document is exactly the field a relying party (RP) reads at bootstrapping to decide which scopes to request. A malformed value here does not break the package's own tests so much as it breaks consumers, which is the classic integration-seam defect. That the fix landed as a patch within days is a positive signal about responsiveness and a caution about test coverage at the protocol-conformance boundary.
Technical risk
scopes_supported, response_types_supported, id_token_signing_alg_values_supported) causes silent, hard-to-attribute consumer failures rather than loud ones. Budget for a conformance check against the OIDC discovery spec in CI, not just unit tests.kid handling, and JWKS cache TTLs are operational concerns the package can support but not decide. Assign an owner before go-live.Key questions
Stack fit
Strong for Laravel 9/10-era applications on PHP 8.1+, particularly where the user store is already Eloquent and authorization decisions can reuse existing policies/gates. The package assumes it can own the well-known routes; confirm no reverse proxy, API gateway, or CDN in front of the app is already serving or rewriting /.well-known/*, which is a common and confusing collision.
Migration path
Greenfield IdP: install, publish config, generate keys, register routes, map claims, then wire the first RP in staging. Brownfield (existing bespoke token endpoint): run the package's discovery/JWKS endpoints alongside the legacy issuer, point one low-risk RP at the new issuer, and only decommission the old path once token validation parity is proven across all RPs. Do not cut over the issuer value in place — changing iss invalidates every cached token and every RP's stored configuration.
Compatibility
Verify explicitly: Laravel version constraint, PHP version, and the lcobucci/jwt (or equivalent) transitive dependency — JWT libraries have historically shipped breaking changes on minor bumps. Confirm compatibility with the firebase/php-jwt or web-token stack used elsewhere in the estate so we are not running two JWT implementations with divergent clock-skew and algorithm-allowlist behavior. Also confirm the fix in 1.2.1 matches the exact shape our RPs expect (array vs. space-delimited string) — OIDC specifies a JSON array, and RPs vary in how strictly they enforce it.
Sequencing
scopes_supported change is the only delta.Maintenance Low routine burden — the package is small and the 1.2.1 delta is a one-line metadata correction. The real maintenance cost is not code upgrades but contract maintenance: every RP's assumptions about our discovery document and claim set. Treat the published discovery document as a versioned public API with a changelog and a deprecation policy, even though the package does not enforce one.
Support Support load will concentrate at two seams: RP onboarding (scope and claim mismatches) and key rotation windows. Both are predictable and should be pre-documented as runbooks rather than handled as incidents. Because the failure signature of the 1.2.1 bug class is "RP silently requests the wrong scopes," expect a long tail of misattributed bug reports pointing at RP teams before anyone suspects the IdP metadata.
Scaling
Discovery and JWKS endpoints are static, cacheable, and trivially scalable — serve them with aggressive cache headers and consider fronting them at the edge. The scaling concern is the token endpoint: signing is CPU-bound and synchronous. Establish a baseline tokens/sec per app instance, and note that horizontal scaling of the Laravel app requires all instances to share the same key material and kid — this is the single most common way an otherwise-fine OIDC deployment falls over during an autoscale event.
Failure modes
kid. Mitigate with overlap windows and published cache TTLs shorter than the rotation interval.nbf/exp validation failures across hosts. Set and document an explicit leeway value..well-known handlers — fails loudly at deploy, but only if a smoke test hits the endpoint.Ramp-up Estimate roughly one engineer-week to a validated first-RP integration for a team already fluent in OAuth2/OIDC, and two to three weeks if the team is learning the protocol on this package — the package hides the plumbing but not the concepts, and debugging a failed OIDC flow without protocol fluency is where timelines actually slip. Add half a week for key custody and rotation runbook authoring, which is organizational work rather than coding. Recommend one engineer own the IdP surface end to end (metadata contract, keys, RP onboarding) rather than distributing it, given how much of the operational risk is in cross-team contract discipline rather than in the code.
How can I help you explore Laravel packages today?