PHPackages                             jeffersongoncalves/filament-oidc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. jeffersongoncalves/filament-oidc

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

jeffersongoncalves/filament-oidc
================================

Filament 5 plugin for OpenID Connect (OIDC) single sign-on, powered by jeffersongoncalves/laravel-oidc.

v1.0.0(1mo ago)218MITPHPPHP ^8.2CI passing

Since Apr 26Pushed 1mo agoCompare

[ Source](https://github.com/jeffersongoncalves/filament-oidc)[ Packagist](https://packagist.org/packages/jeffersongoncalves/filament-oidc)[ Docs](https://github.com/jeffersongoncalves/filament-oidc)[ GitHub Sponsors](https://github.com/jeffersongoncalves)[ RSS](/packages/jeffersongoncalves-filament-oidc/feed)WikiDiscussions 1.x Synced 1w ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

[![Filament OIDC](https://raw.githubusercontent.com/jeffersongoncalves/filament-oidc/1.x/art/jeffersongoncalves-filament-oidc.png)](https://raw.githubusercontent.com/jeffersongoncalves/filament-oidc/1.x/art/jeffersongoncalves-filament-oidc.png)

Filament OIDC
=============

[](#filament-oidc)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2e638144b50a6281e9b93c7a3a8e3a0c0b21190e68ced3a27c82184fcbcbc821/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6566666572736f6e676f6e63616c7665732f66696c616d656e742d6f6964632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeffersongoncalves/filament-oidc)[![PHPStan](https://camo.githubusercontent.com/47c7c7d36c1c2936ec6d10ff96015f0ec086239479c53138bb1777095868bbe5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6566666572736f6e676f6e63616c7665732f66696c616d656e742d6f6964632f7068707374616e2e796d6c3f6272616e63683d312e78266c6162656c3d7068707374616e267374796c653d666c61742d737175617265)](https://github.com/jeffersongoncalves/filament-oidc/actions/workflows/phpstan.yml)[![Tests](https://camo.githubusercontent.com/55da60c7521a10ffedff0e95cae3e99e502ea20c6d3352191d246e5fc577cf0d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6566666572736f6e676f6e63616c7665732f66696c616d656e742d6f6964632f74657374732e796d6c3f6272616e63683d312e78266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/jeffersongoncalves/filament-oidc/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/ed9b21857565ba1adb85cbfb10aad64750a9cd9c3d4116d00fb7787370687fa2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6566666572736f6e676f6e63616c7665732f66696c616d656e742d6f6964632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeffersongoncalves/filament-oidc)

Drop-in OpenID Connect single sign-on for Filament v5 panels, powered by [`jeffersongoncalves/laravel-oidc`](https://github.com/jeffersongoncalves/laravel-oidc). Works in single- and multi-panel apps, supports per-panel guards, and stores OIDC identities in a polymorphic table so the host application's `users` table is never altered.

Compatibility
-------------

[](#compatibility)

Plugin branchFilament`1.x`v5> This plugin is published only for Filament v5. Branch `1.x` is the first major of the plugin and does not follow the legacy table where `1.x` historically targeted Filament v3.

Installation
------------

[](#installation)

```
composer require jeffersongoncalves/filament-oidc
```

Publish and run the migration that creates the `oidc_identities` table:

```
php artisan vendor:publish --tag="filament-oidc-migrations"
php artisan migrate
```

Optionally publish the configuration and translations:

```
php artisan vendor:publish --tag="filament-oidc-config"
php artisan vendor:publish --tag="filament-oidc-translations"
```

Configure the underlying `laravel-oidc` driver via the standard environment variables:

```
OIDC_ISSUER_URL=https://idp.example.com
OIDC_CLIENT_ID=your-client-id
OIDC_CLIENT_SECRET=your-client-secret
```

> The plugin computes the redirect URI from the panel route, so you do **not** need to set `OIDC_REDIRECT_URI`. Register `https://your-app.test/{panel}/oidc/callback` with your Identity Provider for every panel that exposes the plugin.

Registering the plugin in a panel
---------------------------------

[](#registering-the-plugin-in-a-panel)

```
use JeffersonGoncalves\Filament\Oidc\FilamentOidcPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->id('admin')
        ->path('admin')
        ->login()
        ->plugin(
            FilamentOidcPlugin::make()
                ->guard('web')
                ->autoCreateUsers(true)
        );
}
```

Multi-panel setup
-----------------

[](#multi-panel-setup)

Register the plugin once per panel. Each panel gets its own routes (`filament.{panel-id}.oidc.{redirect|callback|logout}`), its own callback URL, and may opt into a different guard or user model.

```
// AdminPanelProvider
$panel->plugin(
    FilamentOidcPlugin::make()
        ->guard('web')
        ->userModel(\App\Models\User::class)
);

// CustomerPanelProvider
$panel->plugin(
    FilamentOidcPlugin::make()
        ->guard('customer')
        ->userModel(\App\Models\Customer::class)
        ->autoCreateUsers(false)
);
```

Register the per-panel callback URL with your IdP:

```
https://your-app.test/admin/oidc/callback
https://your-app.test/customer/oidc/callback

```

Linking identities to users
---------------------------

[](#linking-identities-to-users)

The plugin stores every IdP/subject pair in the `oidc_identities` table and links it to the authenticated model through a polymorphic relationship. Add the `HasOidcIdentities` trait to expose the `oidcIdentities()` relation on your authenticatable model:

```
use JeffersonGoncalves\Filament\Oidc\Concerns\HasOidcIdentities;

class User extends Authenticatable
{
    use HasOidcIdentities;
}
```

The default callback handler:

1. Looks up `oidc_identities.{issuer, subject}`.
2. Falls back to matching the local user by email.
3. Creates a new user when `auto_create_users` is enabled, otherwise throws `OidcAuthenticationException::autoCreateDisabled()`.

Customising user provisioning
-----------------------------

[](#customising-user-provisioning)

Override either the attribute mapping or the full resolution closure:

```
FilamentOidcPlugin::make()
    ->userAttributesUsing(fn (\Laravel\Socialite\Two\User $oidcUser) => [
        'name' => $oidcUser->getName(),
        'email' => $oidcUser->getEmail(),
        'tenant_id' => $oidcUser->user['tenant'] ?? null,
        'password' => bcrypt(\Illuminate\Support\Str::random(40)),
    ])
    ->resolveUserUsing(function (\App\Models\User $template, \Laravel\Socialite\Two\User $oidcUser) {
        return \App\Models\User::query()->updateOrCreate(
            ['email' => $oidcUser->getEmail()],
            ['name' => $oidcUser->getName()],
        );
    });
```

Logout (RP-initiated)
---------------------

[](#logout-rp-initiated)

Enable IdP logout to redirect users to the issuer's `end_session_endpoint` after the local logout completes:

```
FilamentOidcPlugin::make()->logoutFromIdp(true);
```

Use the named route from your blade templates (e.g. inside a custom user menu):

```

    @csrf
    Log out

```

Events
------

[](#events)

EventWhen`JeffersonGoncalves\Filament\Oidc\Events\OidcUserAuthenticated`Every successful callback, before the redirect.`JeffersonGoncalves\Filament\Oidc\Events\OidcUserCreated`Only when a brand-new user is provisioned.Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Jefferson Gonçalves](https://github.com/jeffersongoncalves)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance91

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

44d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/411493?v=4)[Jefferson Gonçalves](/maintainers/jeffersongoncalves)[@jeffersongoncalves](https://github.com/jeffersongoncalves)

---

Top Contributors

[![jeffersongoncalves](https://avatars.githubusercontent.com/u/411493?v=4)](https://github.com/jeffersongoncalves "jeffersongoncalves (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

authenticationfilamentfilament-pluginlaraveloidcopenid-connectphpsingle-sign-onsocialitessolaravelAuthenticationSSOsocialitesingle sign onOpenID Connectfilamentfilament-pluginjeffersongoncalvesoidcfilament-oidc

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jeffersongoncalves-filament-oidc/health.svg)

```
[![Health](https://phpackages.com/badges/jeffersongoncalves-filament-oidc/health.svg)](https://phpackages.com/packages/jeffersongoncalves-filament-oidc)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[andrewdwallo/filament-companies

A comprehensive Laravel authentication and authorization system designed for Filament, focusing on multi-tenant company management.

34654.9k2](/packages/andrewdwallo-filament-companies)[dutchcodingcompany/filament-socialite

Social login for Filament through Laravel Socialite

2141.1M10](/packages/dutchcodingcompany-filament-socialite)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84192.9k7](/packages/stephenjude-filament-two-factor-authentication)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6643.3k](/packages/marcelweidum-filament-passkeys)[chrisreedio/socialment

Provides Socialite functionality for Filament.

10896.9k1](/packages/chrisreedio-socialment)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
