My app receives an access token by virtue of an implicit grant. Now I am attempting to use this token to access the content servers RPC service. I am not 100% sure if this is the correct way to do it as I am unable to get it to work.
$code = (string) $this->params()->fromQuery('code', null);
$client = new HttpClient(
'http://www.example.com/api/books',
array(
'maxredirects' => 0,
'timeout' => 30
)
);
$client->setMethod('GET');
$client->setHeaders(
[
'Accept' => 'application/json',
'Authorization' => 'Bearer '.$code
]
);
try {
$response = $client->send();
} catch (\Exception $e) {
throw new \Exception($e);
}
Here is the example in postman which is failing:
In this question the authorization_code was used and not the access_token and that's why it failed.