You'll need a Windows Authentication action on your Home controller:
[Authorize]
[Route("AD")]
public ActionResult WindowsLogin(string returnUrl = null)
{
FormsAuthentication.SetAuthCookie(User.Identity.Name, false);
if (!string.IsNullOrEmpty(returnUrl) && Url.IsLocalUrl(returnUrl)) return Redirect(returnUrl);
return RedirectToAction(nameof(Index));
}
Then update your
web.config
file to turn on Windows authentication for that route:
<location path="AD">
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true" />
<basicAuthentication enabled="true" />
<anonymousAuthentication enabled="false" />
</authentication>
</security>
</system.webServer>
</location>
You may need to "unlock" these sections:
If you're using IIS, open IIS Manager, open the "Feature Delegation" page from the Management group. Find the four "Authentication - ..." sections, and ensure that they are set to "Read/Write".
If you're using IIS Express, you'll need to edit the
applicationHost.config
file, which is located in the hidden ".vs\Project_Name\config" folder within your solution folder.