You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have just finished configure Passport v11 in my API, but I am having issue issuing tokens.
Laravel V10
Passport V11
API served using: php artisan server --port=5000
When I try to login using postman:
With PHP8.1, after a while I get the error below:
cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
With PHP8.2
Connection refused for URI http://127.0.0.1:5000/oauth/token`
Here is where I make the call:
/** @var User $user */
$user = $this->userModel->query()->where('email', $data['email'])->first() ?? throw
new ModelNotFoundException('Your
credentials do not match our record');
$payload = [
'grant_type' => 'password',
'client_id' => config('passport.personal_grant_client.id'),
'client_secret' => config('passport.personal_grant_client.secret'),
'username' => $data['email'],
'password' => $data['password'],
'scope' => '*',
];
$response = Http::asForm()->post(route('passport.token'), $payload); // This fails and return the error above
But when I directly POST to http://127.0.0.1:5000/oauth/token
with all the required params in the snippet above, the token is issued without any issue.
I would like to note that, I have a similar setup for another project with Passport v7 and it works without issue, but with most recent version of Passport I am getting the same problem.
For instance, I have another project, which just hang when trying to logging locally but work on the live server.
Edit:
Event though to token is return and the above error is thrown, record for oauth_access_tokens & oauth_refresh_tokens are being created in the database.
Edit: issue sovled
I decide to start using Laravel-valet again, I am just surprised that, it is working with one API and the rest not.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have just finished configure Passport v11 in my API, but I am having issue issuing tokens.
php artisan server --port=5000
When I try to login using postman:
With PHP8.1, after a while I get the error below:
With PHP8.2
Here is where I make the call:
But when I directly POST to
http://127.0.0.1:5000/oauth/token
with all the required params in the snippet above, the token is issued without any issue.
I would like to note that, I have a similar setup for another project with Passport v7 and it works without issue, but with most recent version of Passport I am getting the same problem.
For instance, I have another project, which just hang when trying to logging locally but work on the live server.
Edit:
Event though to token is return and the above error is thrown, record for
oauth_access_tokens
&oauth_refresh_tokens
are being created in the database.Edit: issue sovled
I decide to start using Laravel-valet again, I am just surprised that, it is working with one API and the rest not.
Beta Was this translation helpful? Give feedback.
All reactions