Microsoft Graph REST API 真实账户访问令牌请求错误 AADSTS65001

Microsoft Graph REST API Error AADSTS65001 on access token request with live accounts

我正在使用 Microsoft Grap API 让用户登录我的网络应用程序并获取他们的基本配置文件。我已按照 the microsoft overview.

上的每个步骤进行操作

对于任何实时电子邮件(已尝试 outlook.fr 和 hotmail.com),我在请求访问令牌时遇到此错误:

AADSTS65001: No permission to access user information is configured for 'MyAppId' application, or it is expired or revoked.

有什么我想念的吗?我在我的 Azur 门户应用程序上只配置了一个权限,在 Microsoft 图 api 委托权限下:"Sign in and read user profile"。没有其他应用授权。

当我尝试使用 office365 帐户时,一切正常。我什至可以调用 https://graph.microsoft.com/v1.0/me 并获得结果。

我检查了我的 redirect_uri,它们在授权和访问令牌请求上都匹配。我已经打开了 APPLICATION IS MULTI-TENANT 选项并修改了清单文件,除此之外一切都是默认的。

Microsoft Graph api 可以处理我的网络应用程序的实时登录吗?如果是这样,谁能帮我理解我哪里错了?

这是我的授权 link,适用于任何帐户:

https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=MyClientId&redirect_uri=MyUri

这是我的访问令牌请求 link :

https://login.microsoftonline.com/common/oauth2/token
POST data : grant_type=authorization_code&code=MyCode&client_id=MyClientId&client_secret=MySecret&resource=https%3A%2F%2Fgraph.microsoft.com%2F&redirect_uri=MyUri

除了 Azure Active Directory 帐户之外,为了能够使用 Live Id/Microsoft 帐户,请使用 https://graph.microsoft.io/docs/authorization/converged_auth 中所述的新融合授权流程。

您需要使用 https://apps.dev.microsoft.com and instead of statically declaring delegated permissions for your app it will be able to dynamically request permissions using a scope query parameter when requesting a token or code from https://login.microsoftonline.com/common/oauth2/v2.0.

而不是通过 Azure 门户注册您的应用程序