[2019-05-16 21:54:33] local.INFO: OAuth\Common\Http\Exception\TokenResponseException: Unable to parse response. in /home/memorable/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/Amazon.php:74
Stack trace:
#0 /home/memorable/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/AbstractService.php(130): OAuth\OAuth2\Service\Amazon->parseAccessTokenResponse('\x1F\x8B\x08\x00\x00\x00\x00\x00\x00\x03L\xD4\xB7\xCE\xAC...')
#1 /home/memorable/app/controllers/user/UserLoginController.php(435): OAuth\OAuth2\Service\AbstractService->requestAccessToken('ANLdQgTbWizDNFl...')
The response from Amazon looked like this:
ã L‘∑Œ¨f E—˛>∆__$2å;¬ÜúCÛâ4¿ês∞˝ÓŸç€]-ù?í,+ñ¨CSÙ?
I updated the getAccessTokenEndpoint method and everything worked as expected:
From
return new Uri('https://www.amazon.com/ap/oatoken');'
to
return new Uri('https://api.amazon.com/auth/o2/token');
The response from Amazon looked like this: ã L‘∑Œ¨f E—˛>∆__$2å;¬ÜúCÛâ4¿ês∞˝ÓŸç€]-ù?í,+ñ¨CSÙ?
I updated the getAccessTokenEndpoint method and everything worked as expected: From
return new Uri('https://www.amazon.com/ap/oatoken');'
toreturn new Uri('https://api.amazon.com/auth/o2/token');