无法使用 OAuth2 验证 Microsoft 个人帐户

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

我有一个使用 OAuth2 对 M365 标准用户进行身份验证的应用程序,工作正常。现在,我们有一个用户的 Outlook.com 地址不起作用。根据我找到的一些文档,我将登录网址更改为:

https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize?client_id=...

(对于标准用户,我用“普通”而不是“消费者”。

我还需要更改 Azure AD 中应用程序清单中的两个属性:

"accessTokenAcceptedVersion": 2,
"signInAudience": "AzureADandPersonalMicrosoftAccount",

完成这些更改后,我将进入 Microsoft 登录屏幕,然后请求权限。接受后,我收到错误消息“抱歉,我们无法让您登录”,然后是“AADSTS90023 不支持 Microsoft 帐户登录”。

同时,我收到一封来自 Microsoft 的电子邮件,内容是“新应用程序可以访问您的数据”。知道我怎样才能让它工作吗?

azure oauth-2.0 azure-active-directory exchangewebservices
1个回答
0
投票

我创建了一个 Azure AD 多租户应用程序:

enter image description here

注意:您可以使用

common
端点对多租户和 Microsoft 个人帐户用户进行身份验证,因为
signInAudience
AzureADandPersonalMicrosoftAccount
。请参阅此MsDoc

我使用以下端点来对多租户和 Microsoft 个人帐户用户进行身份验证

即使使用

consumers
端点,Microsoft 个人用户也必须能够进行身份验证。

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?
&client_id=ClientID
&response_type=code
&redirect_uri=https://jwt.ms
&response_mode=query
&scope=https://graph.microsoft.com/.default
&state=12345

enter image description here

enter image description here

我收到了电子邮件:

enter image description here

如果问题仍然存在,请检查以下内容:

  • 如果 Azure AD 应用程序未配置为支持个人帐户登录,通常会出现错误“AADSTS90023 Microsoft 帐户登录不受支持”。
  • 尝试与其他 Microsoft 个人帐户用户一起登录并检查。
  • 尝试在隐身窗口中登录并检查。
© www.soinside.com 2019 - 2024. All rights reserved.