azure - MSAL - 使用 IntegratedWindowsAuth 获取令牌时出现问题
问题描述
我正在使用 MSAL 通过集成 Windows 身份验证从 Azure 中的身份验证应用获取令牌。代码是:
var tenant = $"https://login.microsoftonline.com/<myTenantId>";
var clientId = "<myClientId>";
var scopes = new string[] { "https://graph.microsoft.com/.default" };
var publicApplication = PublicClientApplicationBuilder.Create(clientId).WithAuthority(tenant).Build();
var token = await publicApplication.AcquireTokenByIntegratedWindowsAuth(scopes).ExecuteAsync();
这会引发以下异常:
Integrated Windows Auth is not supported for managed users.
- 我已验证运行应用程序的用户不是托管用户(用户是在本地 AD 中创建的,并已通过 AD Connect 同步同步到 Azure AD)。
- 我已在我的 Azure 租户中启用 SSO 并使用直通身份验证。
- 管理员已同意授权申请。
我已按照https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/Integrated-Windows-Authentication中的步骤进行操作,据我所知,我没有错过任何内容。
我的配置中是否有一些我可能遗漏的东西?对此的任何帮助都将受到高度赞赏。
解决方案
根据我与 Microsoft 的讨论,直通身份验证不支持 IWA(在我的情况下就是这种情况)。要使 IWA 正常工作,我们需要在我们的环境中安装 ADFS。
推荐阅读
- javascript - OpenLayers 3 Bootstrap 手风琴不起作用
- java - 每次我想运行时,我都必须(项目>清理)。怎么不呢?
- tensorflow - “导入错误:没有名为 Cython.Build 的模块”在 Google Cloud ML Engine 上进行训练
- javascript - 使用jQuery单击li时如何选择单选按钮?
- java - 如何更改此代码以更新当前用户而不是创建新用户?
- java - 在 JUnit 中记录失败的假设
- java - Java转Scala,调用超类构造函数如何处理?
- script# - ScriptSharp,无法解析引用类型
- php - 如何连接到支付网关
- css - 如何将媒体查询应用于除一台设备之外的所有设备