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
Storage.get() url expires earlier than established #9346
Comments
Sounds like the IAM role session expires which causes this. https://aws.amazon.com/premiumsupport/knowledge-center/presigned-url-s3-bucket-expiration/ My idea: Storage.get documentation can be modified to reflect these limits, and if the user really needs access to longer times - then developers can create an IAM user and create a apig+lambda endpoint to generate a longer signed url using the iam user's credentials. Any other feasible solution? |
I created a test app using react with the close to the latest packages and was able to reproduce the issue when an authenticated user signs in, uploads a photo, and creates a link as well as when an unauthenticated users does this as well. It seems that the max duration of the link created was 1 hour based on two test uploads and duration of the corresponding links created before they expired. This matches up with the maximum duration of when some AWS STS tokens expire. I've created two docs with my reproduction attempts, results and relevant documentation here: |
Hi @ahilashsasidharan , following up here. As you mentioned, the expiration time of the pre-signed url is dependent on the session and will max out at 1 hour. I've updated the documentation to reflect this and will close out this issue. Thanks! |
Before opening, please confirm:
JavaScript Framework
Not applicable
Amplify APIs
Storage
Amplify Categories
storage
Environment information
Describe the bug
When i generate url with Storage.get and I established expiration at 680400, url expires earlier, sometimes in hours
example signed url obtained:
Expected behavior
Expected to generate url that expire in 7 days
Reproduction steps
1.- Storage.get the file
2.- save signed url
3.- url expires earlier than established
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: