简体   繁体   English

ASP.Net MVC 4管理角色-Windows身份验证

[英]ASP.Net MVC 4 Manage Roles - Windows Authentication

I have a MVC 4 web application which I want to implement SqlRoleProvider and Windows Authentication into it. 我有一个MVC 4 Web应用程序,我想在其中实现SqlRoleProviderWindows Authentication
After I did search in Google I added SqlRoleProvider tables in my database by running aspnet_regsql command in VS command prompt. 在Google中进行搜索后,我通过在VS命令提示符下运行aspnet_regsql命令在数据库中添加了SqlRoleProvider表。 Then I added this to my web.config : 然后我将其添加到我的web.config

<authentication mode="Windows" />
<roleManager enabled="true">
  <providers>
    <clear />
    <add connectionStringName="PortalDbContext" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
    <add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" />
  </providers>
</roleManager>

Now I need to know how can I manage roles? 现在我需要知道如何管理角色? I mean how to create/edit/delete roles and assign/un-assign users from roles? 我的意思是如何创建/编辑/删除角色以及从角色分配/取消分配用户?
Should I create these pages by myself or there is something already available may be with NuGet ? 我应该由我自己创建这些页面还是NuGet已经提供了某些功能?

I usually just roll my own. 我通常只是自己滚。 And this has been years, not sure if its supported anymore, but you can use the Asp.Net Web Site Administration Tool if your on IIS. 这已经有好几年了,不确定是否已经支持了,但是如果您在IIS上,则可以使用Asp.Net网站管理工具 It's slow and clunky but if I recall get's the job done. 它很慢而且很笨拙,但是如果我记得完成的话。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM