Cloudfront signed urls with alternative domain name

0

I've setup Cloudfront and AWS and I've created a separate Behaviour with Restricted View Access and and in my app I'm using CloudFrontUrlSigner from the Java API to sign urls like this:

return CloudFrontUrlSigner.getSignedURLWithCannedPolicy('https://d2q5345wrel4pb8.cloudfront.net/test.jpeg', backendProperties.getAws().getKeyId(), keyFactory.generatePrivate(keySpec), cal.getTime());

and this works fine - I am able to open the url in the browser, the parameters are there and everything works fine.

Now I've also added one entry in Alternative Domain Names: cdn.mycompany.com, and so I try to sign the URL again with the same code:

return CloudFrontUrlSigner.getSignedURLWithCannedPolicy('https://cdn.mycompany.com/test.jpeg', backendProperties.getAws().getKeyId(), keyFactory.generatePrivate(keySpec), cal.getTime());

but the url in the browser says:


<Error>
<Code>AccessDenied</Code>
<Message>Access denied</Message>
</Error>

What am I missing?

질문됨 7달 전234회 조회
1개 답변
0
수락된 답변

So I figured it out. My cdn.mycompany.com CNAME record in Cloudflare had Proxied=TRUE. Once I set it to FALSE it started to work fine.

답변함 7달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠