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
Marc
Marc9mo ago
You can create your own login and/or add a different guard $panel ->authGuard('admin') ->authPasswordBroker('admins') ->login(CustomLogin::class)
rullyka
rullykaOP9mo ago
how to setting auth?
awcodes
awcodes9mo ago
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.
rullyka
rullykaOP9mo ago
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
awcodes
awcodes9mo ago
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.
rullyka
rullykaOP9mo ago
Is there any reference that I can learn from?
awcodes
awcodes9mo ago
Maybe, but o don’t have a link to give you.
rullyka
rullykaOP9mo ago
So, i can use login(App\Http\Controllers\Auth\Login:class) ?
awcodes
awcodes9mo ago
Yes.
rullyka
rullykaOP9mo ago
and use Illuminate\Support\Facades\Auth; to authenticated?
awcodes
awcodes9mo ago
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.
rullyka
rullykaOP9mo ago
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.
Marc
Marc9mo ago
For that, instead of creating a custom login, I would recommend that you create a middleware.
Want results from more Discord servers?
Add your server