Comments (1)
Hi Nicolas,
I think that the login with Auth::attempt($credentials)
is just authentication with session.
In the first comment of the issue has the answer:
Yes attempt() doesn't work with token guards, only Guards that implement StatefulGuard
To stateless auth using laravel passport you should send a request to oauth/token
route passing you user credentials to get the access token. Ex.:
POST /oauth/token HTTP/1.1
Host: localhost
Accept: application/json, text/plain, */*
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache
{
"username":"[email protected]",
"password":"password",
"grant_type" : "password",
"client_id": "client-id",
"client_secret" : "client-secret",
}
And this package add capabilities for you pass the param provider
for request above and retrieve token to an specific model (User, Admin, Customer, etc.).
Maybe you may want to create a token manually. In the answer for issue #32 has an example how to do this.
Regards,
Samuel Martins
from passport-multiauth.
Related Issues (20)
- Auth::attempt() not working HOT 6
- Cannot generate tokens even after providing all form-data correctly. Results with error: { "error": "invalid_credentials", "message": "The user credentials were incorrect." }
- Unable to logout HOT 8
- Error with social login
- When i try to install it on laravel 6 this error (RepositorySecurityException) appear HOT 1
- Its giving me this error on laravel 6 HOT 4
- Support for Passport 8.0 HOT 3
- ignoreMigrations() doesn't exist anymore HOT 5
- Getting unauthenticated error when i try using token of user from id 2, the first user works well HOT 1
- Unit tests as defined is not working HOT 2
- Class 'Symfony\\Bridge\\PsrHttpMessage\\Factory\\DiactorosFactory' not found HOT 12
- Passport route /oauth/personal-access-token not limited to model
- Class 'Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory' not found HOT 2
- I can set provider 'admins' for refreshing tokens even if refresh token is for 'user' HOT 1
- Error "Route [login] not defined"
- Authenticated model without middleware not correct
- During installing of sfelix-martins/passport-multiauth HOT 2
- Login attempt fails
- Laravel / frameworl ^ 8. X and laravel / Passport ^ 10.0 are not supported HOT 6
- Error while using grant_type client_credentials
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passport-multiauth.