zend framework2 - Correct Way to use returned ApiGility Implicit Token -
my app receives access token virtue of implicit grant. attempting use token access content servers rpc service. not 100% sure if correct way unable 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 example in postman failing:

in question authorization_code used , not access_token , that's why failed.
Comments
Post a Comment