I'm trying to get data from Amazon CloudFront which should be secured by Signed Cookies in Angular. How we think it should work:
- I ask backend for cookies on url
https://api2.site.com/app/signerand I got this: HTTP request cookies
- Cookie domain is
site.com
- I ask for the file from CloudFront by HTTP GET from URL
https://live-test.site.com/05687be5-bd5c-4497-9f7a-d10e8b8159bd/live.m3u8. But in this step I don't see any cookies in request and the message from CloudFront isMissing Key-Pair-Id query parameter or cookie value.
I also somewhere read that I must use withCredential in HTTP request so I added this to HTTP Interceptor:
request.url.includes('live-test.site.com')
? request.clone({
withCredentials: true,
setHeaders: { Authorization: idToken },
})
: request.clone({
setHeaders: { Authorization: idToken },
}),
),
Do you have any ideas how to make it work?