amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
611 stars 733 forks source link

Generated Java SDK's getAuthorizationCode unauthorized #1625

Closed MaximeMarcaisBoxtal closed 2 years ago

MaximeMarcaisBoxtal commented 3 years ago

Hi,

I have built the JAVA library as described in Generating a Java SDK with LWA token exchange and authentication, and added the dependencies to my project. My app is Published and "hybrid".

I try to Get an LWA authorization code from MWS credentials from the generated AuthorizationApi, but I get the following response: { "errors": [ { "message": "Access to requested resource is denied.", "code": "Unauthorized", "details": "" } ] }

Request: Request{method=GET, url=https://sellingpartnerapi-eu.amazon.com/authorization/v1/authorizationCode?sellingPartnerId=XXXXXXXXXXXXXX&developerId=XXXXXXXXXXXX&mwsAuthToken=amzn.mws.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, tag=Request{method=GET, url=https://sellingpartnerapi-eu.amazon.com/authorization/v1/authorizationCode?sellingPartnerId=XXXXXXXXXXXXXX&developerId=XXXXXXXXXXXX&mwsAuthToken=mzn.mws.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, tag=null}}

Generated headers: Accept: application/json Content-Type: application/json User-Agent: Swagger-Codegen/1.0.0/java x-amz-access-token: Atc|MQEB... X-Amz-Security-Token: FwoGZXIv... Host: sellingpartnerapi-eu.amazon.com X-Amz-Date: 20210715T134204Z Authorization: AWS4-HMAC-SHA256 Credential=XXXXXXXXXXXXXXXXXXXX/20210715/eu-west-1/execute-api/aws4_request, SignedHeaders=accept;content-type;host;user-agent;x-amz-access-token;x-amz-date;x-amz-security-token, Signature=8f81bbf9...

Am I missing something? Thanks for your help!

Best regards,

xzz953337446 commented 3 years ago

@MaximeMarcaisBoxtal I have the same problem, have you solved it now?

github-actions[bot] commented 2 years ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.