Custom domain for "cognito-idp.us-east-1.amazonaws.com"

0

I have a Cognito app client configured to use USER_PASSWORD_AUTH flow. By POSTing this request:

{ "AuthParameters": { "USERNAME": "{{Username}}", "PASSWORD": "{{Password}}" }, "AuthFlow": "USER_PASSWORD_AUTH", "ClientId": "{{AppClientId}}" }

to "cognito-idp.us-east-1.amazonaws.com", I am able to successfully authenticate and retrieve JWTs.

I would like to CNAME the URL to be something like "auth.mydomain.com", but when I do that, I get a client certificate validation error. Is there anyway to associate a valid certificate so I can CNAME the URL successfully?

3개 답변
2

Hi,

You will not be able to CNAME the cognito endpoint domain but you can create a proxy to this endpoint using API Gateway or CloudFront and you can assign a custom domain to your proxy endpoint. You may find this blog post helpful which demonstrates using CloudFront as a proxy to Cognito endpoint but you can also implement a simpler proxy using API Gateway.

AWS
전문가
답변함 2년 전
  • Thanks for this answer. Is there any alternative method to get the JWT ID Token from the Cognito username/password using a custom domain name? Or is a proxy the only solution here?

1

Hey there,

It sounds like you're looking to use a custom domain name in Cognito. Give this doc a look and come back to us if you have more questions.

profile pictureAWS
답변함 2년 전
  • Not trying to do this for the Hosted UI. Trying to use a simple request with username/password flow to get a JWT ID Token. This works using cognito-idp.us-east-1.amazonaws.com, not mydomain.auth.us-east-1.amazoncognito.com. If I am mistaken, please let me know how to do this without a user entering credentials into a website.

0

sorry i wasn't able to help, removing my answer

profile picture
Sri
답변함 2년 전

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

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

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