Changes in Amazon CloudFront presigning from version 1 to version 2
This topic details the changes in the Amazon CloudFront from version 1 (v1) to version 2 (v2).
High-level changes
Change | v1 | v2 |
---|---|---|
Maven dependencies |
|
|
Package name | com.amazonaws.services.cloudfront |
software.amazon.awssdk.services.cloudfront |
Class names |
1
Latest
version
API changes
Behavior | v1 | v2 |
---|---|---|
Build a canned request | Arguments are passed directly to the API. |
|
Build a custom request | Arguments are passed directly to the API. |
|
Generate a signed URL (canned) |
|
|
Generate a signed cookie (custom) |
|
|
Refactored cookie headers in v2
In Java v1, the Java SDK delivers cookie headers as a Map.Entry<String,
String>
.
Map.Entry<String, String> signatureMap = cookies.getSignature(); String signatureKey = signatureMap.getKey(); // "CloudFront-Signature" String signatureValue = signatureMap.getValue(); // "[SIGNATURE_VALUE]"
The Java v2 SDK delivers the entire header as a single String
.
String signatureHeaderValue = cookies.signatureHeaderValue(); // "CloudFront-Signature=[SIGNATURE_VALUE]"