Owin Authentication In MVC and Web Api
问题 I'm trying to use the same authentication between the MVC controllers and the Web Api controllers. The Web api is in the same project, just in an /Controllers/API/ folder. I can't seem to figure out how to authenticate using OWIN, when I logged in through MVC and created a claim and a cookie like the example below. var identity = new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name,"Admin"), new Claim(ClaimTypes.Role,"Administrator") , "ApplicationCookie"); var ctx = Request.GetOwinContext();