The hint is in the automatically generated Webapi2 account controller
This getter property is defined as
public string UserIdentity { get { var user = UserManager.FindByName(User.Identity.Name); return user;
and in order to get a UserManager - In WebApi2 -do like the Romans (read as AccountController)
public ApplicationUserManager UserManager { get { return HttpContext.Current.GetOwinContext().GetUserManager<ApplicationUserManager>(); } }
It must be compatible in IIS and self-service mode.
Karan Bhandari Oct 18 '15 at 5:50 2015-10-18 05:50
source share