I’m using standard forms authentication with my custom membership and roles providers. Everything fine, except user deletion: if I delete user from the database, he remains happily logged in as long as he have the cookie. So, as I can see, standard authentication dosn’t require anything except cookie, it doesnt even care whether user exists or not.
So my questions are:
-
How can I make standard authentication at least check whether user exists or not before letting him in?
-
How secure is standard authentication?
You could implement a custom Authorize attribute and in the
AuthorizeCoremethod once you have called the base method, verify if the user exists in the database before letting him in by returning true. Notice though that this checking in database will happen on each request.Forms authentication exists since the early days of ASP.NET and it is a proven and secure technology if used properly.