I am sending request to POST api.myserver.com/v1/oauth/token
to get a token with client_credentials as follows:
$client = new GuzzleHttp\Client; // A guzzle client
$response = $this->client->post('http://api.myserver.com/v1/oauth/token', [
'form_params' => [
'grant_type' => 'client_credentials',
'client_id' => 'MY_CLIENT_ID',
'client_secret' => 'MY_CLIENT_SECRET',
'scope' => ''
],
'headers' => [
'Accept' => 'application/json'
]
));
I am using apiato framework so the default laravel passport token generating routes have been modified to something like api.myserver.com/v1/oauth/token
and hence the path.
Now the code above is throwing a 404 not found exception
when I run it from the browser. It's working fine when I run it on POSTman. And also it works fine when I run it in the test environment.
Client error: `POST http://api.myserver.com/v1/oauth/token` resulted in a `404 Not Found` response:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" co (truncated...)
I tried changing the path to http://myserver.com/oauth/token
with no luck. What could be going wrong?