title: Proper place for adding custom user claims
body: <p>There is a user class, which has field named "Avatar", which stores path to  his profile picture. I want to show it in header inside the partial view. So I desided to add a claim to user identity. I put this lines of code inside my <code>IdentityConfig.cs</code> class:</p>
  
  <pre><code> public override Task&lt;ClaimsIdentity&gt; CreateUserIdentityAsync(AppUser user)
          {
              if(!System.String.IsNullOrEmpty(user.Avatar))
                  user.Claims.Add(new AppUserClaim() { ClaimType = "avatar", ClaimValue = user.Avatar});
  
              return user.GenerateUserIdentityAsync((AppUserManager)UserManager);
          }
  </code></pre>
  
  <p>But there is a problem: after a period of time (aprox. 1 hour) this Claim disappears and there's no avatar shown. I found out, that <strong>asp.net identity</strong> framework regenerates user's identity every 30 minutes (default). And according to this:</p>
  
  <pre><code> regenerateIdentityCallback: (manager, user) =&gt;
                              user.GenerateUserIdentityAsync(manager)
  </code></pre>
  
  <p>it calls <code>GenerateUserIdentityAsync</code>method of user's class. At this momment it becomes not clear to me. There are two, on the first sight, similar methods of generating user identity:</p>
  
  <ol>
  <li>Inside <strong>AppUser</strong> class, which takes <code>usermanager</code> class as a parameter - <code>public async Task&lt;ClaimsIdentity&gt; GenerateUserIdentityAsync(AppUserManager manager)</code></li>
  <li>Inside <strong>SignInManager</strong>- <code>public override Task&lt;ClaimsIdentity&gt; CreateUserIdentityAsync(AppUser user)</code></li>
  </ol>
  
  <p>What's the purpose of that? Where each of this methods has been used? And which one should I use to add custom user claim?</p>