- Newest
- Most votes
- Most comments
Unfortunately, in the scenario you've described, there isn't a straightforward way to create a custom URL for Amazon Cognito using the app domain as you've suggested (like https://app.bigcompany.com/auth).
Amazon Cognito's custom domain feature requires you to have control over the domain or subdomain you want to use. The service is designed to work with a fully qualified domain name (FQDN) that you own and can manage DNS records for.
In your case, where you don't have control over the bigcompany.com domain or the ability to create subdomains under it, you're limited in your options for creating a custom Cognito URL.
The default option in this situation would be to use the Amazon Cognito prefix domain. This domain is hosted on amazoncognito.com and follows the format:
https://[your-prefix].auth.[aws-region].amazoncognito.com
While this doesn't provide the seamless branded experience you're looking for, it is a functional solution that doesn't require additional domain control.
If using the Cognito prefix domain is not acceptable for your use case, you might need to explore alternative solutions. These could include:
-
Working with the big company to set up the necessary subdomain (auth.app.bigcompany.com) and delegating control to you.
-
Using a different authentication solution that allows more flexibility in URL structure.
-
Implementing a proxy solution on your end that could route /auth requests to the Cognito endpoint, though this would require careful security considerations.
It's worth noting that this limitation is in place partly for security reasons, ensuring that the authentication domain is properly controlled and secured. While it can be inconvenient in situations like yours, it helps maintain the integrity of the authentication process.
Sources
Using the Amazon Cognito prefix domain for managed login - Amazon Cognito
Could you generate a working example for the proxy solution, using nginx on the frontend and nodejs on the backend?
answered a year ago
Relevant content
asked 2 years ago
asked 3 years ago
asked a year ago
asked 4 years ago
- AWS OFFICIALUpdated 3 years ago
