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.

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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ