bambamboole / laravel-oidc-client
OpenID Connect relying-party (client) for Laravel — log users in through any OIDC provider
Package info
github.com/bambamboole/laravel-oidc-client
pkg:composer/bambamboole/laravel-oidc-client
Requires
- php: ^8.4
- illuminate/auth: ^13.0
- illuminate/contracts: ^13.0
- illuminate/http: ^13.0
- illuminate/support: ^13.0
- lcobucci/jwt: ^5.0
- phpseclib/phpseclib: ^3.0.15
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v0.32.0
- v0.31.0
- v0.30.0
- v0.29.0
- v0.28.0
- v0.27.1
- v0.27.0
- v0.26.0
- v0.25.0
- v0.24.0
- v0.23.0
- v0.22.0
- v0.21.2
- v0.21.1
- v0.21.0
- v0.20.0
- v0.19.0
- v0.18.0
- v0.17.3
- v0.17.2
- v0.17.1
- v0.17.0
- v0.16.0
- v0.15.0
- v0.14.2
- v0.14.1
- v0.14.0
- v0.13.4
- v0.13.3
- v0.13.2
- v0.13.1
- v0.13.0
- v0.12.1
- v0.12.0
- v0.11.0
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.0
- v0.8.0
- v0.7.0
- v0.6.0
- v0.4.0
- v0.3.0
- v0.2.0
- dev-test/oidc-client-fake-override-precedence
- dev-feat/route-config-defaults-and-prefix
- dev-feat/client-testing-kit
- dev-feat/client-docs
- dev-feat/backchannel-logout-client
- dev-feat/relying-party-module
This package is auto-updated.
Last update: 2026-09-12 15:47:39 UTC
README
An OpenID Connect (OIDC) relying party for Laravel — log your users in through
any OIDC provider using the Authorization Code + PKCE flow, with strict id_token
validation against the provider's JWKS.
This is the client-side companion to
bambamboole/laravel-oidc (the OIDC
provider). The two are deliberately separate packages: an app that only needs to
consume an identity provider should not pull in a full OAuth2 authorization server,
TOTP, QR codes, and WebAuthn. Point this package at your own laravel-oidc provider
for self-SSO, or at any third-party IdP (Keycloak, Auth0, Okta, …).
What you get
- Authorization Code + PKCE login against any spec-compliant provider, with one-time
state/nonceand single-use callback context. - Discovery-driven setup — endpoints and JWKS come from
/.well-known/openid-configuration, cached, with automatic JWKS refresh on unknownkidso provider key rotation just works. - Strict
id_tokenvalidation — RS256 signature,iss,aud,azp,nonce, andexp/nbf/iatwith configurable leeway. - A user-resolution seam —
OidcClient::resolveUsersUsing(...)maps token claims to your user model; the default resolves the guard provider bysub. - RP-initiated logout to the provider's end-session endpoint with
id_token_hint. - Back-channel logout (opt-in) — accepts provider-pushed logout tokens and tears down the matching local session immediately (server-side session drivers) or on the next request (enforcement middleware).
Requirements
- PHP
^8.4 - Laravel 13
Installation
composer require bambamboole/laravel-oidc-client
# Optional: publish the config
php artisan vendor:publish --tag=oidc-client-config
The service provider is auto-discovered. The relying party is off until enabled:
OIDC_RP_ENABLED=true OIDC_RP_ISSUER=https://id.example.com OIDC_RP_CLIENT_ID=... OIDC_RP_CLIENT_SECRET=... # optional — omit for a public client
See the docs for the full walkthrough, every config key, and the back-channel logout setup.
Documentation
The full documentation lives at
bambamboole.github.io/laravel-oidc —
the client pages are under
/client/. It is built
from the docs/ directory of the
laravel-oidc monorepo.
Changelog
All packages in the suite are versioned in lockstep; see the monorepo changelog.
Development
The suite runs from the root of the monorepo, which holds the single Composer install for all packages:
composer install
composer check # pint --test, phpstan, rector --dry-run, pest
Tests run in isolation through Orchestra Testbench — no external OIDC provider is required.
License
MIT.