【发布时间】:2018-04-11 08:53:38
【问题描述】:
按照 Auth0 的建议,我正在尝试使用以下请求从 Postman 调用 (POST) Auth0 委托端点:
Content-Type: 'application/json'
{
"client_id": "{CLIENT_ID}",
"grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",
"id_token": "{YOUR_ID_TOKEN}",
"target": "lwTL1rYVfC0KsBUFPeKWY3HvGjbIgdDM",
"api_type": "salesforce_api",
"scope": "openid"
}
我收到此错误,即使上述请求中包含了 grant_type 参数:
{
"error": "invalid_request",
"error_description": "Missing grant_type parameter"
}
我在这里做错了什么?
【问题讨论】:
-
请包含您发送的请求的代码。请删除 Google-oauth 标签,它不会显示您正在使用 Google 的 oauth 服务器
-
此错误可能是由于未正确设置内容类型而导致的。如果无法测试您的代码,我将无能为力。请包括stackoverflow.com/help/mcve。
-
Auth0 docs 表示您做对了,但another page implementing OAuth2 建议 grant_type 可能需要进行 URL 编码,即在每种情况下将
:替换为%3A。这有什么帮助吗? -
Postman 有针对 OAuth 2.0 的具体说明和“帮助者”,如下所述:getpostman.com/docs/postman/sending_api_requests/authorization
-
Nat:DalmTo 的意思是单击链接,阅读有关 MCVE 的信息,然后在您的答案中包含一个。 Nat & @DaImTo:但是,MCVE 注释在这种情况下不适用。问题中提供的发布请求尽可能接近工作的 MCVE,因为不适合提供工作的客户端 ID 或令牌 ID。
标签: oauth oauth-2.0 postman auth0 auth0-delegated-admin