我正在升级网站以使用MVC,我正在寻找设置身份验证的最佳方法.
此时,我已登录Active Directory:验证用户名和密码,然后设置Auth cookie.
如何在登录时存储用户的角色信息,以便我的控制器在用户浏览网站时查看这些角色?
[Authorize(Roles = "admin")]
从Active Directory获取角色列表没有问题.我只是不知道把它们放在哪里,以便控制器能够看到它们.
asp.net authentication asp.net-mvc forms-authentication
asp.net ×1
asp.net-mvc ×1
authentication ×1
forms-authentication ×1