Download the PHP package admin9/laravel-oidc-client without Composer
On this page you can find all versions of the php package admin9/laravel-oidc-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download admin9/laravel-oidc-client
More information about admin9/laravel-oidc-client
Files in admin9/laravel-oidc-client
Package laravel-oidc-client
Short Description Laravel OIDC Client package with PKCE support for SSO/SLO authentication
License MIT
Homepage https://github.com/admin9-labs/laravel-oidc-client
Informations about the package laravel-oidc-client
Laravel OIDC Client
English | 简体中文
A Laravel package for OIDC (OpenID Connect) authentication with PKCE support. Architecture-agnostic — works with Blade, Livewire, Inertia, or any Laravel stack.
Features
- OIDC Authorization Code Flow with PKCE
- Pluggable authentication strategy via
OidcAuthenticatorinterface - Automatic user provisioning from OIDC claims
- Flexible user mapping configuration
- Token revocation and SSO logout support
- Rate limiting on all endpoints
- Event system for authentication lifecycle
Requirements
- PHP 8.2+
- Laravel 11.x or 12.x
- Persistent session driver (redis, database, file)
Installation
Configuration
Add to .env:
Update app/Models/User.php:
Usage
Routes
The package registers these routes:
| Method | URI | Description |
|---|---|---|
| GET | /auth/redirect |
Start OIDC flow |
| GET | /auth/callback |
Handle callback, create session, redirect |
How It Works
- User visits
/auth/redirect— redirected to your OIDC provider - After authentication, the provider redirects back to
/auth/callback - The package exchanges the authorization code for tokens, fetches user info, and creates/updates the local user
- The configured
OidcAuthenticatorhandles login (default: web session guard) and returns a response
Authentication Flow
Login Link
Handling Errors
Authentication errors are flashed to the session:
Logout
Create a logout controller using OidcService:
Custom Authenticator
By default, the package uses SessionAuthenticator which logs in via Laravel's web guard. For SPA/JWT scenarios, implement the OidcAuthenticator interface:
Register it in config/oidc-client.php:
Events
The package dispatches two events during the authentication lifecycle:
| Event | Properties | When |
|---|---|---|
OidcUserAuthenticated |
$user, $userInfo, $isNewUser |
After successful authentication |
OidcAuthFailed |
$errorCode, $errorMessage |
When authentication fails |
Example listener:
Optional Configuration
Documentation
- Configuration - All config options and environment variables
- Troubleshooting - Common issues and solutions
License
MIT
All versions of laravel-oidc-client with dependencies
illuminate/http Version ^11.0||^12.0
illuminate/routing Version ^11.0||^12.0
illuminate/support Version ^11.0||^12.0
spatie/laravel-package-tools Version ^1.16