-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
amplify storage returns 403 #6777
Comments
@ShehryarKh can you please provide the complete error message. Is there a user currently logged in? Please try the following as well: Retrieve the logged-in user's identityId: // inside an async-friendly closure...
try {
const { identityId } = await Auth.currentCredentials();
// set the identityId in state
} catch(e) {}
// ... Then, in your component, specify the <div class="my-8">
<amplify-s3-image-picker
button-text="yes"
header-title="Campaign Photo"
track="true"
:path="imgpath"
+ identity-id={identityId}
></amplify-s3-image-picker>
</div>
<div>
- <amplify-s3-image level="public" track="true" img-key="ball.png" />
+ <amplify-s3-image
+ level="public"
+ track="true"
+ img-key="ball.png"
+ identity-id={identityId}
+ />
</div> |
@harrysolovay I followed your advice and I am still getting 403. Yes, there is an authenticated user logged in. Also, I will need the ability to show non authenticated users photos from storage. Full error below:
Thanks for the continuous help. |
@ShehryarKh So when you try to retrieve image as both auth and unauth user you get 403? |
@ashika01 Yes. I am not sure why. I can put to the s3 bucket fine.
but 403 on
|
Couple of thing:
Sorry for the prior comment about |
Also, I notice you save in path
|
@ashika01 I am not sure what you mean by How can I confirm permission for auth on the s3 bucket? if there a command? Or somewhere where amplify stores that?
|
Right here,
So in the try |
@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. |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Describe 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:
amplify add auth
amplify add api
amplify add storage
-> auth users can create
-> unauth/guest users can read.
Expected behavior
display the image on app
Code Snippet
What is Configured?
If applicable, please provide what is configured for Amplify CLI:
aws-exports
file:The text was updated successfully, but these errors were encountered: