Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SHMDesign's avatar

ExpiredToken with S3 temporaryUrl

I need to generate a temporaryUrl for 1 day (or more), I use this simple code:

Storage::temporaryUrl('path/to/file', now()->addDay());

It works fine on local environment but when deployed, Vapor uses a token expiring before the expiration I specify. The file is accessible around 6 hours then I got an "ExpiredToken" error code. Any idea on how to get the file expiration working right on Vapor ?

It seems to be related to this:

https://aws.amazon.com/premiumsupport/knowledge-center/presigned-url-s3-bucket-expiration

https://stackoverflow.com/questions/59405707/aws-s3-signed-url-x-amz-security-token-expires-too-early

Thanks

0 likes
0 replies

Please or to participate in this conversation.