Reputation: 4345
I have a .NET MVC 4 application that uses Windows Authentication. I want to check whether the user is a member of a particular Active Directory group and if so, display an additional menu option:
if(User.IsInRole("WellnessAdmins"))
{
<li>
<b>@Html.ActionLink("Admin","Admin","Home")</b>
</li>
}
When deployed to the server, this works fine; the Admin link is displayed. However, when I launch the application from Visual Studio, the Admin link is not displayed. My local computer and the server are on the same domain. Why this weird behavior?
Upvotes: 2
Views: 1356
Reputation: 1039538
If you are using IIS Express make sure that you have enabled Windows Authentication and disabled Anonymous Authentication in the properties of your project:
Upvotes: 2