【问题标题】:Graph API authentication | The request body must contain the following parameter 'grant_type'图 API 认证 |请求正文必须包含以下参数“grant_type”
【发布时间】:2020-12-29 05:25:11
【问题描述】:

我正在尝试使用 Postman 对 Graph 进行身份验证。我有以下要求:

类型:帖子 网址:https://login.microsoftonline.com/[MyTenantIdHere]/oauth2/v2.0/token

身体 = 原始:

{
  client_id: "[MyClientID]",
  grant_type: "client_credentials",
  scope: "https%3A%2F%2Fgraph.microsoft.com%2F.default",
  client_secret: "[MyClientSecret"
}

但是,我收到了这个错误:

"error_description": "AADSTS900144: 请求正文必须包含 以下参数:'grant_type'。

知道如何解决这个问题吗?

【问题讨论】:

  • 您可以尝试使用 curl curl -X POST -d “grant_type=client_credentials&client_id=clientid&client_secret=secret&scope= https%3A%2F%2Fgraph.microsoft.com%2F.default” https://login.microsoftonline.com/tenantid/oauth2/v2.0/token 并告诉我们是否有帮助。
  • 它适用于这种格式,我猜它不接受 JSON。

标签: microsoft-graph-api azure-ad-graph-api office365api


【解决方案1】:

在邮递员中尝试 X-www-form-urlencoded。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-09-05
    • 2015-10-04
    • 2021-11-22
    • 1970-01-01
    • 2021-10-18
    • 2021-08-04
    • 2021-10-20
    • 1970-01-01
    相关资源
    最近更新 更多