- 最新
- 最多得票
- 最多評論
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.
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.
I did follow the article but still get 405. See below... curl "https://testservice.auth.us-west-2.amazoncognito.com/oauth2/token" -X POST -d "grant_type=client_credentials&client_id=6tl85tkf7ageolj63ps9pdekf&scope=test/user" -H "Authorization: Basic NnRsODV0a2Y3YWdlb2xqNjNwczlwZGVrZjprZWMyNDcwMnV1N3RrdGkxbWIyOWNmZGdpZ2pkMTVkcGM5Mzc4MjBlN2ZyMnZmMG9pMjY="
相關內容
- AWS 官方已更新 2 年前
Thank you, I finally got it working after adding content-type to the header as you suggested.