F
Filamentβ€’13mo ago
Crayon

Different Auth Guard

I've been trying to integrate Filament with Auth0. I am using Auth0 Laravel SDK: https://github.com/auth0/laravel-auth0 And I did setup my auth.php: Guard
'auth0' => [
'driver' => 'auth0.guard',
'provider' => 'auth0-provider',
],
'auth0' => [
'driver' => 'auth0.guard',
'provider' => 'auth0-provider',
],
Provider
'auth0-provider' => [
'driver' => 'auth0.provider',
'repository' => UserRepository::class,
],
'auth0-provider' => [
'driver' => 'auth0.provider',
'repository' => UserRepository::class,
],
config/filament.php
'auth' => [
'guard' => env('FILAMENT_AUTH_GUARD', 'auth0'),
'pages' => [
'login' => \App\Filament\Auth\Login::class,
],
],
'auth' => [
'guard' => env('FILAMENT_AUTH_GUARD', 'auth0'),
'pages' => [
'login' => \App\Filament\Auth\Login::class,
],
],
And I tweaked the login logic a little bit. However, the problem now is the return type from the Filament::auth() should be Illuminate\Contracts\Auth\Guard But Auth0 SDK returns Auth0\Laravel\Auth\Guard. Has anybody tried to switch the authentication logic to a tool like Auth0?
GitHub
GitHub - auth0/laravel-auth0: Laravel SDK for Auth0 Authentication ...
Laravel SDK for Auth0 Authentication and Management APIs. - GitHub - auth0/laravel-auth0: Laravel SDK for Auth0 Authentication and Management APIs.
No description
No description
No description
4 Replies
Dennis Koch
Dennis Kochβ€’13mo ago
Looks like it's not possible to use this Guard, as it doesn't implement Laravel Guard Contract.
Crayon
CrayonOPβ€’13mo ago
Yeah. I had to fork it and implement Laravel Guard Contract. Thanks anyway πŸ™
cyberx11
cyberx11β€’9mo ago
Hi, Im implementing auth0 in filament too, did u manage to make it work?
Crayon
CrayonOPβ€’8mo ago
@cyberx11 Sorry I just saw your message. Yes, I forked Auth0 SDK and tweaked their Guard class a bit to make it compatible with Filament.
Want results from more Discord servers?
Add your server