A security stamp is a random value generated based on the user's user name and password.
Following a chain of method calls, I traced the security stamp's origin to the SecurityStamp
property of the Microsoft.AspNet.Identity.EntityFramework.IdentityUser<TKey, TLogin, TRole, TClaim>
class.
However, I am unable to find the code that sets this value. I found only one setter of this property and that is the EntityFramework layer that provides the core storage (IUserStore<..>
, IRoleStore<...>
, etc.).
// From Microsoft.AspNet.Identity.EntityFramework.UserStore<...>
public virtual Task SetSecurityStampAsync(TUser user, string stamp)
{
this.ThrowIfDisposed();
if (user == null)
{
throw new ArgumentNullException("user");
}
user.SecurityStamp = stamp;
return Task.FromResult<int>(0);
}
However, I found no code that calls into the SetSecurityStampAsync
method.
This would obviously be reset whenever the user's credentials are changed or when a new user is created.
What code sets this value?