I'm having trouble accessing the MVC application shortly after making the configuration in Web.config to do the authentication with the windows user. The error occurs when you enable the following line:
<authentication mode="Windows" />
<authorization>
<allow users="maquinaLocal\usuario"/>
<deny users="?" />
</authorization>
And when running the application the following error occurs:
Server Error in Application '/'. Access denied. Description: An error occurred while accessing the resources needed to fulfill this request. Maybe the server is not configured to access the required URL.
Remembering that my Home controller looks like this:
public ActionResult Index()
{
var windowsIdentity = WindowsIdentity.GetCurrent();
if (windowsIdentity != null)
ViewBag.User = windowsIdentity.Name;
return View();
}
And when I comment on the "authorization" line of Web.config the application works normally.
<!--<authorization>
<allow users="maquinaLocal\usuario"/>
<deny users="?" />
</authorization>-->
What can this be?