Dec 19, 2018
0
Level 1
Guzzle Post request returning 'Unauthorized' PP OAuth2
Hey,
I am following the Laravel 5.7 Documentation for OAuth2 implementation, but i'm getting the following error when making a most request with GuzzleClient:
Client error: POST http://rankup.dinmor/oauth/token resulted in a 401 Unauthorized response: {"error":"invalid_credentials","message":"The user credentials were incorrect."}
I am hosting my laravel app on xampp.
$http = new Client();
$response = $http->post('http://rankup.dinmor/oauth/token', [
'form_params' => [
'grant_type' => 'password',
'client_id' => '2',
'client_secret' => '5n053udMlMksA1AyVmLUxoxTVr2Algnm4aTRjkQk',
'username' => $request->email,
'password' => $request->password,
'scope' => '',
],
]);
return json_decode((string) $response->getBody(), true);
Does anyone have experience with this? I've googled a bit around and seen other people with the same issue, but haven't really found a working solution.
Please or to participate in this conversation.