图谱API认证|请求正文必须包含以下参数“grant_type”

问题描述 投票:0回答:2

我正在尝试使用 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'。

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

microsoft-graph-api azure-ad-graph-api office365api
2个回答
2
投票

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


0
投票

或者您选择“raw”并以这种形式放置:

client_id=535fb089-9ff3-47b6-9bfb-4f1264799865
&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default
&client_secret=qWgdYAmab0YSkuL1qKv5bPX
&grant_type=client_credentials
© www.soinside.com 2019 - 2024. All rights reserved.