I've achieve to deploy your solution on top of our amplify application.
Amplify application is using --> Framework Next.js - SSR
The issue is that I think our Next.js code should not redirect correctly to desired url.
What should I paste to my env var NEXTAUTH_URL ?
Before (=without your solution)
NEXTAUTH_URL = "ourcustomamplifydomain.com"
Now (=with your solution on top)
NEXTAUTH_URL = "ourcustomamplifydomain.com" --> redirect to amplify url so get WebACL (not desired)
NEXTAUTH_URL = "cloudfrontdistributiondomain.com" --> error 403 (not redirecting to signin page of cognito)
Maybe that should be an issue of configuration of Cognito user pool on our side (we have a Cognito domain, is it an issue ? that was working well with it before)
We kept our custom domain on amplifyapp.
In Cognito > App integration > User pool client > hosted UI > Allowed callback URLs
--> I've tried to add all my url but not working :/ (before juste Amplify custom domain was needed)
Finally, with a call with multiples peoples of AWS, we've attend to fix the problem :
First it's important to add an alternante domain name to CloudFront distribution (and adding a Route53 Alias record pointing to cloudfront distrib)
Secondly, you will have to set Viewer settings like bellow in Behaviors > Edit > Viewers
Then, you will have to add a "Origin request policy" in your CloudFront distribution which is in
Behaviors > Edit > Origin request policy > AllViewerExceptHostHeaders
Enjoy your web application whith a frontend security almost optimized waiting for native integration of WAF to Amplify :D
Hi,
I've achieve to deploy your solution on top of our amplify application.
Amplify application is using --> Framework Next.js - SSR The issue is that I think our Next.js code should not redirect correctly to desired url.
What should I paste to my env var NEXTAUTH_URL ?
Before (=without your solution)
NEXTAUTH_URL = "ourcustomamplifydomain.com"
Now (=with your solution on top)
Maybe that should be an issue of configuration of Cognito user pool on our side (we have a Cognito domain, is it an issue ? that was working well with it before)
We kept our custom domain on amplifyapp.
In Cognito > App integration > User pool client > hosted UI > Allowed callback URLs --> I've tried to add all my url but not working :/ (before juste Amplify custom domain was needed)
Can you help on this please ?