How to change ->Login() to Another URL
I have a user and password database on another site as an SSO, I want to use it as auth login in filament using the existing API. How to do
13 Replies
You can create your own login and/or add a different guard
$panel
->authGuard('admin')
->authPasswordBroker('admins')
->login(CustomLogin::class)
how to setting auth?
Who is your SSO provider? #dododedodonl-socialite might work for you. But Filament still defaults to Laravels authentication so you should be able to just use the laravel socialite package directly.
I want my system to bypass filament's built-in login authentication process by detecting whether there are cookies or not. Cookies are generated from when I access my other web for example: sso.example.com/login?redirect=https://tomywebsite.com. the result of this login is what generates cookies. If like this how do I solve it? please give me a solution
There’s nothing special about filaments authentication. It’s still the laravel authentication under the hood so anything you can do in laravel will work.
Is there any reference that I can learn from?
Maybe, but o don’t have a link to give you.
So, i can use login(App\Http\Controllers\Auth\Login:class) ?
Yes.
and use Illuminate\Support\Facades\Auth; to authenticated?
Do a source dive. Follow the classes and see what is happening. It’s a short hop.
If you’re using teams or multi tenancy it can be more complicated. But filament doesn’t impart opinions on the default Laravel authentication.
An authenticated user is still just that whether it’s filament based or not.
ok, work. but problem is what is route to dashboard filament default?
because I added return redirect()->intended(Filament::getUrl()); the result is Route [filament.portals.pages.dashboard] not defined.
For that, instead of creating a custom login, I would recommend that you create a middleware.