【发布时间】:2017-04-20 16:40:16
【问题描述】:
我目前正在开发的应用程序是一个巨大的 ASP.NET MVC Web 应用程序,它使用传统的 Windows 身份验证模型。我们正在尝试使用 Identity Server 3 和 Open ID Connect 迁移到单点登录模型。
关于我的问题,在使用 Identity Server 时,是否有任何方法/解决方法可以在用户组的基础上提供访问权限?这里的问题是我的用户组可能是基于角色的或 Active Directory 组。我正在寻找类似 InMemoryGroup 的东西(类似于 InMemoryUser)。
为可以基于角色或不基于角色的用户组模仿以下内容:
new InMemoryUser
{
Username = "harry",
Password = "thisispassword@123",
Subject = "1",
Claims = new Claim[]
{
new Claim(Constants.ClaimTypes.Name, "Harry Potter"),
new Claim(Constants.ClaimTypes.GivenName, "Harry"),
new Claim(Constants.ClaimTypes.FamilyName, "Potter"),
new Claim(Constants.ClaimTypes.Email, "harry.potter@hogwarts.com"),
new Claim(Constants.ClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean),
new Claim(Constants.ClaimTypes.Role, "Administrator"),
}
}
我对 Identity Server 和 Open ID Connect 比较陌生,无法在线找到任何东西,非常感谢任何线索。
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-4 asp.net-web-api identityserver3 openid-connect