- Newest
- Most votes
- Most comments
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="
Relevant content
- asked 7 months ago
- Accepted Answerasked 5 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 months ago
Thank you, I finally got it working after adding content-type to the header as you suggested.