When I activate the OWIN logout-everywhere feature via security stamps and use the OnValidateIdentity
-Callback of the CookieAuthenticationProvider
with the SecurityStampValidator
-class, the user is logged out every time he closes the browser.
provider.OnValidateIdentity =
SecurityStampValidator.OnValidateIdentity<MyUserManager, MyUser>(
System.TimeSpan.FromSeconds(10),(manager, user) => {
return user.GenerateUserIdentityAsync(manager);
});
However, when I do the plumbing myself (lookup and comparison of the security stamps, rejecting or renewing the identity) in the OnValidateIdentity
-callback, everything seems to work fine.
Is this a known bug, or do I miss here something? Or is there a good documentation about the CookieAuthenticationProvider
and the use of OnValidateIdentity
?
Digging with google only shows me some simple samples, but gives no further insight.
Additional information
- I use an own implementation of the UserStorage which saves all the data in a database
- I noted that every page request calls two times the GetSecurityStampAsync of the UserStorage, wheras when I use my implementation, only one call is done.
- Installed Identity Version is 2.0.1