http://forums.asp.net/t/1894061.aspx?ASP+NET+MVC+integration+with+Active+Directory
In regards to the post above.
I have been trying to implement Active Directory Security using IIS Express for my local development enviornment using Visual Studio 2013. Currently I have modified the IIS Express to allow me to override the authentication methods in the applicationhost.config. As specified in this post
IIS Express Windows Authentication
In addtion, I also made the default applicationpool user a valid Domain Administrator. I modified the Authorize attribute on the Home Controller of a basic MVC Site. Then on the home controller added the following code, as suggested in the first post I mentioned. The code is below. When I browse to this page It only shows the groups of the local machine that I belong to. It does not show the groups of the Domain that I belong to. Because of this I cannot actually Authorize any groups on my Domain only groups that exist locally. Why is that? Any assistance would be helpful.
<h2>Logged in as: @User.Identity.Name</h2>
<h2>Groups</h2>
<ul>
@{
var id = User.Identity as System.Security.Principal.WindowsIdentity;
foreach(var g in id.Groups)
{
var name = g.Translate(typeof(System.Security.Principal.NTAccount)).Value;
var nameWithoutAuthority = name;
var idx = name.IndexOf('\\');
if (idx >= 0)
{
nameWithoutAuthority = name.Substring(idx + 1);
}
<li>@g.Value,
@name,
@User.IsInRole(name),
@nameWithoutAuthority,
@User.IsInRole(nameWithoutAuthority)
</li>
}
}
</ul>