Last post Dec 17, 2015 06:51 AM by Klein Zhang
Dec 16, 2015 11:34 AM|lakshmiprasanna|LINK
we have a requirement where we need to develop a admin portal where Windows authentication and authorization should happen against specific user group of Directory List in Active directory, here I am listing the changes we need to do in ASP.NET and IIS,
can some once correct the same, this is some thing very urgent, thanks in advance :
1.ASP.NET MVC steps for authentication:
Web.config changes: -
2.ASP.NET MVC steps for Authorization:
Here we give domain group where users related to the group has access to control methods in ASP.NET MVC.
3. IIS steps for setting up windows authentication :
a .Open Control Panel, Programs, Programs and Features, Turn Windows features on or off, and expand the Internet Information Services node, under this enable “Windows Authentication”
b. In IIS disable anonymous authentication and enable Windows Authentication for the respective ASP.NET MVC deployed folder.
Dec 16, 2015 02:24 PM|EnenDaveyBoy|LINK
Used the [Authorize] attribute on the controller
Dec 17, 2015 03:22 AM|lakshmiprasanna|LINK
Thanks for responding, do we need to use Authorize attribute on the controller class along with ASP.NET MVC steps for Authorization that is in web.config, can you please confirm.
Dec 17, 2015 06:51 AM|Klein Zhang|LINK
Thanks for responding, do we need to use Authorize attribute on the controller class along with ASP.NET MVC steps for Authorization that is in web.config, can you please confirm
You'd like to use windows authentication with active directory groups as roles in mvc project, isn't it? sometimes, we need to makr some configurations. In our web.config, Like this:
<authentication mode="Windows" />
<deny users="?" />
<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider">
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
Then we could use the Windows authentication and authorization in our action.
[Authorize(Roles = @"DOMAIN\ADGroup")]
Public ActionResult Index()
public ActionResult Index()
var User = System.Web.HttpContext.Current.User;
Besides, you could refer to the following links to get more information about Windows Authentication with Active Directory Groups.
I hope it's helpful to you.