Skip to content
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

Credentials correct, Access Denied #25

Closed
Johnafriedman opened this issue Jan 24, 2017 · 2 comments
Closed

Credentials correct, Access Denied #25

Johnafriedman opened this issue Jan 24, 2017 · 2 comments

Comments

@Johnafriedman
Copy link

Hi Ben, Thanks for the library! I inherited a project that records and posts audio files to s3 and has a react web app and a react-native webview bridge app. The web app successfully uploads to s3 on desktop. The native app records a file, receives the credentials from the web app but always fails with on put with access denied. No error is generated in the console. Would you have any suggestions where I could look for a problem? Thanks ~john

@benjreinhart
Copy link
Owner

Hey @Johnafriedman,

This library works by generating the AWS signature needed to make the request. Assuming that

  1. your accessKey & secretKey are correct
  2. your IAM policy is correct

Then this library should generate the correct signature needed to make the request to AWS.

Unfortunately, it's really hard to tell what the error is when there is an access denied error given that something in the generated policy is off, but since it's a cryptographic signature, there is no way to tell (that I know of) which piece in the signature generation is incorrect besides eyeballing the source code over and over again looking for discrepancies between the code here and AWS docs on how to generate a signature.

There have been multiple mentions in other issues about generating policies on the server and I believe some others have forked this library to support server generated policies. I'm still waiting for PRs from anyone who has worked on improving this experience. However, I would want the existing repo to work as is, with additional functionality allowing users to opt in to server generated policies. I unfortunately don't do as much RN development at the moment, so I don't have as much incentive as I used to to spend my free time on this.

TLDR; I'm not sure I can help you debug your access denied issue. No one else has filed issues about AWS responding with access denied and it is still working in my production app, so it leads me to believe something with your particular credentials is causing problems rather than a bug in this library.

@dsernst
Copy link

dsernst commented Feb 9, 2017

I was curious about this too, so I looked into the forks to see if I could find what you were referring to. Here are two that seem to support attaching pre-created policies:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants