The requirements are:
After the Session clears, send the user back to the homepage, and force them to re-login using the Windows Authentication prompt.
Current situation:
I have a javascript countdown timer that when it hits 0, sends an alert saying the session is over. What I want to be able to do is either through Javascript or a Postback to the server, clear the user's credentials
What I've read/tried:
AJAX post to server setting HttpContext.Response, and throwing a HttpException(401)
[HttpPost]
public ActionResult ForceRelogin()
{
//HttpContext.Response.StatusCode = 401;
//HttpContext.Response.End();
//return RedirectToAction("Index", "Home");
//throw new HttpException(401, "");
return new HttpStatusCodeResult(HttpStatusCode.Unauthorized);
}
Neither of these seem to work with AJAX, and I'm unsure of how to cause a regular post back to a controller action that doesn't involve a submit.
Question:
How do I force users to re-authenticate their windows authentication credentials, without using Active-X or changing their IE settings? Bonus Question: How do you postback from javascript to an MVC controller action without using submit or AJAX?