amplify storage returns 403
See original GitHub issueDescribe the bug
Retrieving images using amplify-s3-image
returns 403 forbidden.
I have no issue adding to s3 bucket via amplify-s3-image-picker
retrieving throws a 403. I’ve tried adding files to public folder directly and trying to retrieve, returns 403 .
To Reproduce Steps to reproduce the behavior:
- setup auth
amplify add auth
- setup api
amplify add api
- setup storage
amplify add storage
-> auth users can create -> unauth/guest users can read.
Expected behavior display the image on app
Code Snippet
<div class="my-8">
<amplify-s3-image-picker
button-text="yes"
header-title="Campaign Photo"
track="true"
:path="imgpath"
></amplify-s3-image-picker>
</div>
<div>
<amplify-s3-image level="public" track="true" img-key="ball.png" /> //image uploaded directly to /public
</div>
What is Configured? If applicable, please provide what is configured for Amplify CLI:
- Which steps did you follow via Amplify CLI when configuring your resources.
- Which resources do you have configured?
- If applicable, please provide your
aws-exports
file:
const awsmobile = { "aws_project_region": "us-east-1", "aws_cognito_identity_pool_id": "us-east-1:xxx-xxxx-xxxx-xxxx-xxxxxxxx", "aws_cognito_region": "us-east-1", "aws_user_pools_id": "us-east-1_xxx", "aws_user_pools_web_client_id": "xxxx", "oauth": {} "aws_appsync_graphqlEndpoint": "xx", "aws_appsync_region": "us-east-1", "aws_appsync_authenticationType": "AMAZON_COGNITO_USER_POOLS", "aws_user_files_s3_bucket": "xx", "aws_user_files_s3_bucket_region": "us-east-1" };
- If applicable, please provide your
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
AWS Amplify & React - Storage.put return 403 Forbidden
Authenticated roles can create/read/delete/list objects. Now, in my React application, when I do this: Storage.put(image.name, image, { level: ' ...
Read more >Getting 403 while deploying your app through amplify, no ...
Getting 403 while deploying your app through amplify, no access to the buckets? Lost buckets. Here is the problem : https://github.com/aws ...
Read more >Amplify Storage.put succeeds on iOS, throws axios 403 ...
Amplify Storage.put succeeds on iOS, throws axios 403 forbidden error on android (React Native) ... We have a react-native app that allows users...
Read more >Developers - amplify storage returns 403 - - Bountysource
Retrieving images using amplify-s3-image returns 403 forbidden. I have no issue adding to s3 bucket via amplify-s3-image-picker retrieving ...
Read more >Storage - File access levels - JavaScript - AWS Amplify Docs
When you run amplify add storage , the CLI will configure appropriate IAM policies on the bucket using a Cognito Identity Pool Role....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Right here,
So in the
selectedAuthenticatedPermissions
, it says you have only given put permission. Can you try updating the storage to give get permissions there,try
amplify update storage
and make sure to select both get and put for auth users. And lets see if that does the job.@ashika01 Thank you. That was the issue. I’m not sure why it got set up that way. I got it to work by upgrading the storage to those permissions. Closing Issue.