You can add an avatar property as IdentityClaim
public class ApplicationUser : IdentityUser { public string Avatar { get; set; } public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager) { var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); userIdentity.AddClaim(new Claim("avatar", this.Avatar)); return userIdentity; } }
Inside the razor view, you can access it as follows
@{ var avatar = ((ClaimsIdentity)User.Identity).FindFirst("avatar"); }
tmg source share