无法使用Cognito获取客户端凭据流的令牌

0

【以下的问题经过翻译处理】 我想使用 Cognito 通过客户端凭据进行服务器到服务器的身份验证。 我创建并配置了一个用户池和一个客户端应用程序。 带有客户端 ID 和秘密。 当我使用postman发布到 https://{myapp}.auth.us-west-2.amazoncognito.com/oauth2/token 时,我总是收到 405 错误。 我按照在线示例的指示进行操作,但似乎不起作用。

profile picture
EXPERT
asked 6 months ago12 views
1 Answer
0

【以下的回答经过翻译处理】 嗨,

POST 方法和 /oauth2/token 路径似乎都没问题。您能确认您发送了带有值为 application/x-www-form-urlencodedContent-Type 头部吗?根据 [AWS 文档]https://docs.aws.amazon.com/cognito/latest/developerguide/token-endpoint.html#post-token,此头部是强制要求的,必须包含指定的值。

profile picture
EXPERT
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions