Skip to content

Instantly share code, notes, and snippets.

@DmitrySikorsky
Created August 3, 2017 09:06
Show Gist options
  • Save DmitrySikorsky/0b6de770705736443efd88edb931c12b to your computer and use it in GitHub Desktop.
Save DmitrySikorsky/0b6de770705736443efd88edb931c12b to your computer and use it in GitHub Desktop.
private IEnumerable<Claim> GetUserClaims(User user)
{
List<Claim> claims = new List<Claim>();
claims.Add(new Claim(ClaimTypes.NameIdentifier, user.Id.ToString()));
claims.Add(new Claim(ClaimTypes.Name, user.Name));
claims.AddRange(this.GetUserRoleClaims(user));
return claims;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment