Web API 2 OWIN Bearer token authentication - AccessTokenFormat null?
问题 I have an existing ASP.NET MVC 5 project and I'm adding a Web API 2 project to it. I want to use bearer token authentication and have followed Hongye Sun's tutorial "OWIN Bearer Token Authentication with Web API Sample" and this question as well. In my Login method, for the line Startup.OAuthBearerOptions.AccessTokenFormat.Protect(ticket); , the AccessTokenFormat is null. Any idea why? My AccountController : [RoutePrefix("api")] public class AccountController : ApiController { public