Authorize Attribute Not working in Web API 2.2 using OAuth2
问题 I'm placing an [Authorize(Users = "user@sample.com")] attribute at the top of my Controller: [Authorize(Users = @"user@sample.com")] public class PostsController : ApiController { ... methods... } The user's usernames are the email address. When I sign in with user@sample.com I still get a 401 Unauthorized this controller's methods. I've also notice that, even after the user signs in both System.Web.HttpContext.Current.User.Identity.Name and System.Security.Claims.ClaimsPrincipal.Current