Unable to get token using Cognito for client credentials flow

0

I want to use Cognito for server to server authentication via client credentials. I created and configured a user pool and a client app. with client id and secrets. When I use postman to post to https://{myapp}.auth.us-west-2.amazoncognito.com/oauth2/token, I always get 405 error. I followed some examples online, but they don't seem to work.

已提问 1 年前1621 查看次数
2 回答
0
已接受的回答

Hi,

Both the POST method and /oauth2/token path seem correct. Could you check that you are sending the Content-Type header with application/x-www-form-urlencoded as value? According to AWS documentation, this header is mandatory and must contain the indicated value.

profile picture
专家
已回答 1 年前
  • Thank you, I finally got it working after adding content-type to the header as you suggested.

0

You must make a POST request to the /token endpoint of your Cognito user pool. Please refer to the steps mentioned under "Client credentials grant" section of this article.

AWS
支持工程师
Tarit_G
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则