- Newest
- Most votes
- Most comments
Hello.
Have you created a DNS record for your custom domain?
https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html
It sounds like you've set up Amazon Cognito to handle user authentication for your static website hosted on Amazon S3 and served through CloudFront. The issue you're encountering where accessing "auth.example.net" results in a plain white page is likely due to the configuration of your CloudFront distribution.
Here are a few steps you can take to troubleshoot the issue:
1)CloudFront Behavior Configuration: Ensure that your CloudFront distribution is configured to forward requests to your Amazon Cognito endpoint. You'll need to set up a behavior in CloudFront that forwards requests to your Cognito custom domain.
2)Viewer Protocol Policy: Check the Viewer Protocol Policy setting in your CloudFront distribution. It should be set to "Redirect HTTP to HTTPS" if you want to enforce HTTPS connections.
3)Custom Error Pages: Configure custom error pages in your CloudFront distribution to handle errors gracefully. This can help diagnose any issues that might arise during the authentication process.
4)CloudFront Logs: Check the CloudFront logs to see if there are any errors or unexpected behaviors occurring when accessing "auth.example.net". This can provide valuable insights into what might be going wrong.
5)CORS Configuration: Ensure that your S3 bucket has the appropriate CORS (Cross-Origin Resource Sharing) configuration to allow requests from your Cognito domain.
6)DNS Configuration: Double-check the DNS configuration for "auth.example.net" to ensure it's correctly pointing to your CloudFront distribution.
By checking these configurations and settings, you should be able to diagnose and resolve the issue with accessing your Cognito login page through "auth.example.net". If you're still encountering issues, you may need to review the documentation for CloudFront and Cognito, or consider reaching out to AWS support for further assistance.
Hi Hari thank you so much for taking the time to write this. I checked my behaviour, Path pattern set to default(), and origin my bucket website endpoint. I could set origin to my cognito custom website so i created a new origin for it. I created another behaviour, Path pattern /auth/, origin set to my cognito custom domain. ( is this what you mean by " forward requests to your cognito custom domain?) That didnt work either. :( 4 days into this trying to figure this out
I will go through the rest of the list later as it takes me a while to find where everything is and what they are.
thank you
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a year ago
Hi Riku thanks for your message. I have dsn record done to *.example.net and example.net in route 53 , i used the certificate with auth.example.net when setting up user pool in cognito. Then I created a type A record in route 53, Alias to cloudfront distribution, and got my alias target adress in my custom domain cognito page. My domain works, i also did this test below:
https://myapp.auth.example.com/login?response_type=code&client_id=<your_app_client_id>&redirect_uri=<your_callback_url>
It also works. But when I type in auth.example.net it takes me to a brand new and empty white page.