【发布时间】:2019-12-31 19:01:50
【问题描述】:
我正在尝试通过遵循此tutorial 在使用 Azure Active Directory 的 MVC Core 2.2 应用程序中实现身份验证。
我已经通过设置“groupMembershipClaims”:“SecurityGroup”适当地配置了清单,但仍然没有将组作为用户声明的一部分。看来我应该得到这样的东西
https://www.red-gate.com/simple-talk/cloud/security-and-compliance/azure-active-directory-part-4-group-claims/
在检查声明时,我似乎得到的只是“http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid:”
似乎如果用户分配了超过 4 个组,那么他们
will not be sent as part of the token. 并且需要使用 GraphAPI 为用户拉取组。
我似乎找不到任何资源来说明如何实现这一点并让它与它一起工作
services.AddAuthorization(options =>
{
options.AddPolicy("Editor", policy => policy.RequireClaim("groups","XXXXXXXXXXXX"));
});
有人能指出我正确的方向吗?
【问题讨论】:
标签: c# azure authentication asp.net-core-mvc azure-active-directory