How do I make AuthorizeAttribute work with local Administrators group in ASP.NET MVC 3 intranet application?

二次信任 提交于 2019-12-05 07:15:06

Follow my tutorial How to Create an Intranet Site Using ASP.NET MVC You need to use the built-in AspNetWindowsTokenRoleProvider class , which uses Windows groups as roles

[Authorize(Roles = @"BUILTIN\Administrators")]

Will only work if you are an admin on the IIS server. If you deploy your application to a production server for your company, you will need to be made a local admin on the production server.

Ryand.Johnson

You can a custom AD authorization attribute to place above each action or controller. I have done this before and did something very similar to the link below. This works if you are using forms authentication and not windows.

Active Directory Authorization based on Groups

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!