Closed Master-Daniel closed 1 year ago
Hi there,
Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:
However, this issue will not be locked and everyone is still free to discuss solutions to your problem!
Thanks.
Hey @Master-Daniel ,
did you get any solution for this? I am also trying to implement multi-guard authentication in my application. But, I receive the same error while trying to get Authorize code from 'http://localhost:8000/oauth/authorize'.
It redirect me to the login page, but if I enter credential from custom guard. It's not working.
Is there a better way to get 'authorization code' with 'custom guard table' credentials.
I have also posted same question on laravel.io
https://laravel.io/forum/how-to-use-custom-guard-with-laravel-passport
Thanks, Amit
I was unable to get a solution using passport since passport and sanctum performs the same action I returned back to using laravel sanctum with session
On Wed, May 17, 2023 at 5:04 AM Amitkumar Leuva @.***> wrote:
Hey @Master-Daniel https://github.com/Master-Daniel ,
did you get any solution for this? I am also trying to implement multi-guard authentication in my application. But, I receive the same error while trying to get Authorize code from ' http://localhost:8000/oauth/authorize'.
It redirect me to the login page, but if I enter credential from custom guard. It's not working.
Is there a better way to get 'authorization code' with 'custom guard table' credentials.
I have also posted same question on laravel.io
https://laravel.io/forum/how-to-use-custom-guard-with-laravel-passport
Thanks, Amit
— Reply to this email directly, view it on GitHub https://github.com/laravel/passport/issues/1664#issuecomment-1550666399, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATCOYIDBSM37HNBSTVBURV3XGRE5JANCNFSM6AAAAAAX6MHZDY . You are receiving this because you were mentioned.Message ID: @.***>
Passport Version
11.3
Laravel Version
9
PHP Version
8.1.6
Database Driver & Version
No response
Description
I am trying to create a multi-authentication using passport for my API endpoint have setup my authentication guards and providers with the appropriate model but each time I send a login request I get "Method Laravel\Passport\Guards\TokenGuard::attempt does not exist"
Steps To Reproduce
LOGIN: Auth::guard('super-admin')->attempt(['email' => $credentials['login'], 'password' => $credentials['password']]);
GUARDS: 'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'member' => [ 'driver' => 'passport', 'provider' => 'members', ], 'admin' => [ 'driver' => 'passport', 'provider' => 'admins', ], 'super-admin' => [ 'driver' => 'passport', 'provider' => 'superAdmins', ], 'api' => [ 'driver' => 'passport', 'provider' => 'users', ], ],
PROVIDERS: 'providers' => [ 'members' => [ 'driver' => 'eloquent', 'model' => App\Models\User::class, ], 'admins' => [ 'driver' => 'eloquent', 'model' => App\Models\CooperativeAdmin::class, ], 'superAdmins' => [ 'driver' => 'eloquent', 'model' => App\Models\Admin::class, ],