z-trippete/laravel-oidc-auth

OpenID Connect authentication for Laravel

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 8

pkg:composer/z-trippete/laravel-oidc-auth

1.0.0 2025-05-19 13:58 UTC

This package is auto-updated.

Last update: 2025-09-19 14:43:59 UTC


README

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 vendor: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.