asp.net identity get all roles of logged in user
I created a role based menu for which I followed this tutorial. Some where down that page you'll see this line of code: String[] roles = Roles.GetRolesForUser(); It returns all roles of the currently logged in user. I was wondering how to accomplish this with the new ASP.NET Identity system? It's still pretty new and there is not much to find about it. Controller.User.Identity is a ClaimsIdentity . You can get a list of roles by inspecting the claims... var roles = ((ClaimsIdentity)User.Identity).Claims .Where(c => c.Type == ClaimTypes.Role) .Select(c => c.Value); --- update --- Breaking it