Problems adding roles

Oct 16, 2014 at 4:12 PM
So I've run into issues using roles with identity 2.0 azure tables which may be due to me not knowing how to properly add roles. I'm using essentially the same code from the example but once ive added a role to a user via...

_userManager.RemoveFromRole( req.UserId, Consts.Roles.Approved );

and i then call

HttpContext.Current.GetOwinContext().GetUserManager<ApplicationUserManager>().Users.ToList()

a user gets broken up into multiple multiple "users" one for each user and and an extra "User" per role that a real user has. This has the effect of making the [Authorize(Role = "something")]

Is there something I'm blatantly missing?

Also is there a better way to search users("some kind of prefix search?)
Oct 16, 2014 at 6:34 PM
I figured out part of my problem.

I was using the standard mvc5 project and it came with the following lines....

// Web API configuration and services
// Configure Web API to use only bearer token authentication.
config.SuppressDefaultHostAuthentication();
config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));

which were breaking how the IPrinicpal was being set i believe
Coordinator
Oct 29, 2014 at 8:48 PM
Edited Nov 26, 2014 at 3:58 AM
@ZSAndrewLong - it appears others are experiencing the same issue with this property. See issue: https://identityazuretable.codeplex.com/workitem/1610 . Fixed in Release 1.5.1 and higher.
Marked as answer by dotnetdavy on 10/29/2014 at 1:49 PM