-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access to requested resource is denied? #3
Comments
@kevinhq I haven't personally tested it, but I added documentation for how to pass a credentials_provider (of which STS is one) through to the signer in the readme on https://github.com/ericcj/amz_sp_api Please close this issue if it works |
@ericcj - We tried that documentation, such as:
But, we got same error. We've gone through the AWS SP-API doc several times and we're sure to follow each of them literally. Now, I wonder if SP-API needs Seller account to be active since ours isn't active (but MWS account is) |
that looks correct to me. since it doesn't crash and we're passing credentials_provider directly to their signing gem i don't think it's a bug with our client (you could double-check the requests/headers look sane with config.debugging = true). but please let us know if you can resolve it with them. |
Just tried with
here's how I call it on rails console:
Am I missing something here? |
are you trying to migrate an MWS authorization to the SP-API or do you already have the SP-API refresh_token directly? the fact that the initial access token request (https://github.com/ericcj/amz_sp_api/blob/main/lib/sp_api_client.rb#L35) is succeeding suggests you already have the refresh_token set in config and don't need to call get_authorization_code, which is for the use case of migrating MWS credentials when you don't want to ask the seller to authorize your SP-API app: https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/authorization-api-use-case-guide That use case of migrating MWS authorization (or any "Grantless operation" for that matter) isn't supported by this gem yet and I'm not 100% clear on how to support it but would welcome a patch. if that's what you want to do, it sounds like you'd make the get_authorization_code request either totally outside the context of this gem or just by not passing SpApiClient to it (since it doesn't require any authorization or signing) to get the refresh_token that you'd then set into this gem's configuration to go about making SP-API requests. but i'm a little confused about the final step of that tutorial of how you exchange the authorization code for the refresh_token and where you pass withScopes SCOPE_MIGRATION_API, since I also haven't used the oauth flows myself. i've only been using self-authorization so far. |
Hi, we also use self-authorization. Yes, we:
The problem is, other SP-API end point like Tried with npm package for SP API as well (link), and get exactly same error for any end point. It looks like we really need an active Seller Account as suggested by other folks. |
Hi all, but any movement on this issue @kevinhq |
@Trimakas - not yet. The product owner decides to setup seller account, and it's still on progress. |
Hi everyone, I am trying to integrate with Amazon seller for the first time (not migrating from MWS) I have the same issue "access denied". Can it be the solution for ruby as well? if so, how can it be used? Thank you! |
@estafaa would need to see your log/example usage. there's no known issue if you're providing a valid sp-api refresh_token |
I have a seller account on Amazon, an approved developer, and followed instructions on creating users on AWS.
and response:
Thank you! |
@estafaa your usage is correct, and the token request succeeds so your refresh_token/client_id/secret must be correct, but the aws_access_key must not be correctly associated so you'll have to contact amazon support it doesn't appear to be an issue with this gem |
@ericcj I am trying to create an app with SP API but I am facing the same issue
`
I have read lots of docs and have updated the users and role setting correctly |
@estafaa any update on above issue? I have cross-checked every credential and the whole flow seems okay but still getting error |
That time I contacted Amazon support and they told me that it probably does not work because on my seller account I have a negative $ balance. That time I stopped developing in that direction because we almost always have a negative balance on our amazon seller account because we use Amazon only for MFC (they ship our products), each time we ask them to ship, our balance goes more minus and then we pay Amazon, balance becomes 0, etc. |
If anyone needs a quick solutions to allow for grantless operations (i needed it for notifications) i made this gist You can then create some credentials like this:
To make a Grant-less call |
It is interesting what you say here. We are getting Nowhere in the SP-API docs that I can see does it say WHICH AWS credentials we are supposed to use! I am starting to think we are using the wrong ones. Can anyone shed light on that? |
Log:
It seems we have the same problem here
We've followed the suggestion there, but it doesn't work for us.
Then, one of Amazon support said this:
My question is, is this gem sending that STS token to make a request? I haven't explored the codes base too deep but if you can give any hint, I'll appreciate it.
Thanks for building this.
The text was updated successfully, but these errors were encountered: