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
Can I set PreSignedUrl expire date to forever? #528
Comments
You cannot create a presigned URL without an expiration date. Signature Version 4 has a max expiration of 7 days and Signature Version 2 has a max expiration of a year. |
So, how can I set Signature Version 2 in my code below so that I can get 1 year expiration date:
can you suggest me how can I use signature version 2 in my existing code? |
An alternate solution would be to create the presigned URLs at the point they need to be displayed, instead of creating it in advance and saving it. You can use Signature Version 2 by setting From http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html - |
Closing this issue, feel free to reopen if you have further questions. |
In my case, I need to extend the lifespan of a signed url more than one week because I'm planning to add images from a protected bucket into emails, and once the email is sent, I cannot change the source code. For anyone looking for a solution without messing with more AWS infrastructure or with an insecure and potentially deprecated version other than v4, what I have done is create a custom public link gateway in my own API, where I generate a JWT signed by myself for every file I want to share and define a custom expiry time in that JWT. Then, when I receive a valid JWT, I generate a new signed url with AWS S3 SDK with a limited expiry time (one hour for example) and redirect the incoming request to this generated url. |
I am saving presignedUrl into our database and when I browse the url 10 days later or more the url is broken that means expired, can I make this enable for forever use? or has any alternate of presigned url so that I can direct show the file from amazon to our app like the presign work but without expire time or date?
The text was updated successfully, but these errors were encountered: