title: What code in ASP.NET Identity sets the user's security stamp?
body: <p>A security stamp is a random value generated based on the user's user name and password.</p>
  
  <p>Following a chain of method calls, I traced the security stamp's origin to the <code>SecurityStamp</code> property of the <a href="https://msdn.microsoft.com/en-us/library/dn613256%28v=vs.108%29.aspx" rel="nofollow"><code>Microsoft.AspNet.Identity.EntityFramework.IdentityUser&lt;TKey, TLogin, TRole, TClaim&gt;</code></a> class.</p>
  
  <p>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 (<code>IUserStore&lt;..&gt;</code>, <code>IRoleStore&lt;...&gt;</code>, etc.).</p>
  
  <pre><code>// From Microsoft.AspNet.Identity.EntityFramework.UserStore&lt;...&gt;
  public virtual Task SetSecurityStampAsync(TUser user, string stamp)
  {
      this.ThrowIfDisposed();
      if (user == null)
      {
          throw new ArgumentNullException("user");
      }
      user.SecurityStamp = stamp;
      return Task.FromResult&lt;int&gt;(0);
  }
  </code></pre>
  
  <p>However, I found no code that calls into the <code>SetSecurityStampAsync</code> method.</p>
  
  <p>This would obviously be reset whenever the user's credentials are changed or when a new user is created.</p>
  
  <p>What code sets this value?</p>