https://github.com/xdavidwu/laravel-oidc-auth
OpenID Connect authentication for Laravel
https://github.com/xdavidwu/laravel-oidc-auth
laravel oidc oidc-client
Last synced: 4 months ago
JSON representation
OpenID Connect authentication for Laravel
- Host: GitHub
- URL: https://github.com/xdavidwu/laravel-oidc-auth
- Owner: xdavidwu
- License: mit
- Created: 2021-10-24T06:36:26.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-29T13:21:28.000Z (about 1 year ago)
- Last Synced: 2025-09-26T10:47:14.439Z (9 months ago)
- Topics: laravel, oidc, oidc-client
- Language: PHP
- Homepage:
- Size: 55.7 KB
- Stars: 9
- Watchers: 3
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel OIDC Auth
OpenID Connect authentication for Laravel
Save access token to session storage, and integrate with Laravel `Auth`.
Based on steverhoades/oauth2-openid-connect-client.
## Usage
Publish config with artisan command `vender:publish` for provider `LaravelOIDCAuth\OIDCAuthServiceProvider`, and fill it.
Use `LaravelOIDCAuth\Authenticate` as auth middleware to redirect directly to OIDC login automatically.
### `config/auth.php`
Set guard driver to `oidc-auth-session` to remove tokens from session storage on logout.
Set provider driver to `oidc-auth-session` to make `Auth::user()` return a `LaravelOIDCAuth\OIDCUser` authenticable from saved token.
Alternatively, you can implement a user factory (see `LaravelOIDCAuth\UserFactoryInterface`) for things like creating user DB model and use provider driver like `eloquent`.