I have an interesting problem trying to keep track of expired WIF authentication sessions / cookies.
As a background: MVC 3 uses the Windows Identity Foundation (WIF), which has trust with the ADFS server as STS. The whole site is protected by SSL. STS has a token expiration period of 60 minutes.
When the user writes out manually, we simply call the SignOut method in the FedAuth module:
FederatedAuthentication.WSFederationAuthenticationModule.SignOut(false);
This, of course, removes FedAuth cookies, but here is where the problem starts. If I record these cookies using Fiddler, I can resubmit them to the site during their validity period and still be treated as registered.
I understand that this is done from the privileged position of the browser that accepted the script as a proxy ... but the client is concerned that cookies that have not expired actually pose a significant security risk. They are not sure that SSL protects the site sufficiently, and that if an attacker can carry out a MITM attack, they can use these cookies after the user decides that they are logged out.
I explained that if they are vulnerable after logging out, they are vulnerable during login, but they don’t care ...
So, I was looking for ways to make sure that as soon as the user logs out, the fedauth cookie associated with this login session is processed as expired. The WIF handlers do not seem to have a built-in mechanism for tracking expired tokens, and I have not found anything else related to this.
I guess this is actually a broader issue -> how to detect expired cookies in general? A valid cookie is a valid cookie!
The obvious solution is to keep track of these cookies after logging out in some way, but I would like to avoid the route of user code if possible; like noob, many of the security literature says to avoid user-coding any kind of session mechanics, as you are likely to be mistaken!
- - ASP.NET ?
.