azure-active-directory - 无法通过用户名/密码和 Microsoft Graph API、资源所有者密码凭据、Azure AD 登录

标签 azure-active-directory microsoft-graph-api msal

按照 this example 中的以下步骤,我遇到了以下错误:

第 1 步:克隆或下载此存储库

第 2 步:(可选)向您的 Azure Active Directory 租户注册示例

选择要在其中创建应用程序的 Azure AD 租户

注册客户端应用程序(在控制台上)

第 3 步:配置示例以使用您的 Azure AD 租户

运行应用:

Enter your username
anyuser@outlook.com
Enter your password (no backspace possible)
*********
Response status code does not indicate success: 406 (NotAcceptable).
Press any key to exit
Enter your username
anyuser@msn.com
Enter your password (no backspace possible)
*********
Response status code does not indicate success: 406 (NotAcceptable).
Press any key to exit

我将Supported account types中的设置更改为以下,但得到了同样的错误

任何组织目录中的帐户和个人 Microsoft 帐户(例如 Skype、Xbox、Outlook.com)

Enter your username
anyuser@outlook.com
Enter your password (no backspace possible)
*********
Response status code does not indicate success: 406 (NotAcceptable).
Press any key to exit

有什么想法吗?

anyuser@outlook.com 拥有管理员权限

最佳答案

看起来您可能正在尝试使用个人 Microsoft 帐户。它不适用于此身份验证流程。

密码授予(也称为资源所有者密码凭据授予流程)仅适用于 Azure AD 用户、没有 MFA 且未联合的用户。并且密码不能过期。

关于azure-active-directory - 无法通过用户名/密码和 Microsoft Graph API、资源所有者密码凭据、Azure AD 登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54469600/

相关文章:

azure - Powershell - Get-AzureADAuditSignInLogs 多个筛选器

与 MFA 提示相关的 Azure AD SAML 不一致

microsoft-graph-api - 使用 Microsoft Graph 读取所有用户日历

ios - 如何使用 ADFS 在 IOS 上实现 SSO 功能

azure - 如何在Azure Api管理服务中管理用户帐户?

azure-active-directory - 带有确认屏幕的 Azure AD B2C 重置密码自定义策略

excel - microsoft graph excel api 文档中缺少表/范围相关方法的请求正文

azure-active-directory - 设置 hideFromAddressLists 或 hideFromOutlookClients 时出现 ErrorGroupsAccessDenied

oauth-2.0 - Azure AD B2C 不返回刷新 token

angularjs - 未使用 acquireTokensilent 获取 token ,但使用 acquireTokenpopup Msal-browser 获取 token