Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudfront limited time (signed) URL using Java AWS SDK

How do I create cloudfront signed URL using AWS SDK?

This really seems like it should be easy to do, but I just fail to see it. I generally understand how it works and could probably throw together plain Java code to do it myself. It seems weird that AWS SDK does not provide a method for this.

  • Earlier question but with C#: cloudfront private time limited url.
  • This link explains in theory how such cloudfront urls are generated, but without code examples
  • This link explains how it is done with Java, but it apparently uses JetS3t library instead of AWS SDK. at least I have been unable to locate the used CloudFrontService class in AWS SDK Javadoc
  • This link demonstrates how it is done for S3 using AWS SDK
  • This blog post I found referenced in another related question contains source code for a java class CloudFrontSecurityProvider to do the signing and it is not very complicated.
like image 908
Peter Lamberg Avatar asked Jun 08 '26 12:06

Peter Lamberg


1 Answers

FYI - This blog explains how it is done in Java... very simple.

java.awsblog.com/post/Tx1VE22EWFR4H86/Accessing-Private-Content-in-Amazon-CloudFront

like image 136
solarfingers Avatar answered Jun 10 '26 08:06

solarfingers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!