如何从Azure平台'AADSTS900144'配置代码值

问题描述

每当我从平台连接Azure平台并访问“授权”时,都会收到类似以下的错误

授权失败,并显示错误消息'AADSTS900144: 请求正文必须包含以下参数:“代码”。跟踪ID: 0c2a6ce5-a127-491f-8ef5-34b4b0f11a00相关ID: 5ae207ac-ff51-43da-92a6-0225372c55b1时间戳:2020-10-06 11:19:33Z'

类似地遇到范围值异常。请参考链接AADSTS900144: The request body must contain the following parameter: 'scope' when using legacy Developer Portal

现在,如何获取Azure平台的代码价值?

解决方法

将在authorization request的响应中提供代码。获取后,您将把它包含在令牌请求中,如Request an access token中所述。

,

根据错误消息,请求访问令牌时缺少请求参数。您需要在请求正文中放置以下参数:

enter image description here

对于code,它需要由交互式登录用户获取,您需要在浏览器中执行以下请求来获取它:

https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize?
client_id=6731de76-14a6-49ae-97bc-6eba6914391e
&response_type=code
&redirect_uri=http%3A%2F%2Flocalhost%2Fmyapp%2F
&response_mode=query
&scope=openid%20offline_access%20https%3A%2F%2Fgraph.microsoft.com%2Fmail.read
&state=12345

enter image description here