In my app, the user can be authenticated with a login/password stored in a database or using its digital certificate.
In both ways, if the login succeeds a cookie is created and associated to the user.
FormsAuthentication.SetAuthCookie(model.UserName, false);
return RedirectToAction("Index", "Home");
I need this to be different. If a user logs in with its digital certificate, I want to check if the certificate is there otherwise it throws an error.
The concept is if the certificate is not there, this is because the user has left so nothing can be done.
Is that hard to do?