What is the maximum expiration time for CloudFront signed url

梦想与她 提交于 2019-12-11 18:56:25

问题


I'm using CloudFront for generating signed URL from this doc what is the maximum expiration time for CloudFront signed URL? How should I mention on this DateLessThan argument

Sample Code snippet

String signedUrlCanned = CloudFrontService.signUrlCanned(
    "http://" + distributionDomain + "/" + s3ObjectKey, // Resource URL or Path
    keyPairId,     // Certificate identifier, 
                   // an active trusted signer for the distribution
    derPrivateKey, // DER Private key data
    ServiceUtils.parseIso8601Date("2011-11-14T22:20:00.000Z") // DateLessThan
    );
System.out.println(signedUrlCanned);

Note: It should be a permanent URL like Instagram cdn URL


回答1:


There is no maximum expiration time for CloudFront signed URLs but you always have to specify the DateLessThan parameter.

CloudFront requires this value to prevent users from having permanent access to your private content.

In order to have a permanent-like URL you should set the DateLessThan far in the future.

Also see When Does CloudFront Check the Expiration Date and Time in a Signed URL? and Creating a Signed URL Using a Custom Policy



来源:https://stackoverflow.com/questions/55723691/what-is-the-maximum-expiration-time-for-cloudfront-signed-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!