Hesto / multi-auth

Laravel 5.3, 5.4, 5.5, 5.6, 5.7 multi auth package
MIT License
448 stars 146 forks source link

API Authentication (Passport) #9

Open mansouralex opened 8 years ago

mansouralex commented 8 years ago

Can we use it with Laravel 5.3 API Authentication (Passport) ?

Hesto commented 8 years ago

I think we can because Passport use api guard with Passport driver instead of default api driver. There is no conflict but you have to try it yourself. When you try write it in this topic please.

mansouralex commented 8 years ago

@Hesto just tried it and I'm getting invalid_credentials error response when trying the api guard with the new created provider but It works ok when using the users provider.

Any tips you suggest for this issue?

Also, How we can define multiple api guards in auth.guards array?

Thanks.

Hesto commented 8 years ago

I will test the package with Passport soon.

SidharthRaveendran commented 8 years ago

Passport package isn't built with Multi-Auth in mind, how can we use it for our purpose ?

samirgit commented 7 years ago

@mansouralex multiple guards are not enabled for the reason is inside Laravel\Passport\Bridge\UserRepository getUserEntityByUserCredentials() function 'auth.providers.users.model' is hardcoded, so there is no way to escape using it.

i am using laravel voyager the new admin panel, and my way around it is to change the default guard.

default new guard for voyager (admin panel) usual guards (web, api) for passports (apis)

mansouralex commented 7 years ago

@samirgit thanks for your reply. Yes I noticed that, for the moment we can use JWT for this purpose.

EmadAdly commented 7 years ago

hey guys, anyone tested this package for working together with passport.

thanks.

MohammedSabbah commented 7 years ago

Hi all, see this. It worked for me.

jsdecena commented 7 years ago

Hello, I have created a small package for this: https://github.com/jsdecena/laravel-passport-mutiauth Hope it helps :)

khaledmah commented 5 years ago

after install passport and all configurations run this command php artisan config:cache and will use your providers you selected to use it this worked with me