No OWIN authentication manager is associated with the request

前端 未结 7 1563
故里飘歌
故里飘歌 2020-12-08 01:37

After trying to enable owin & AspNet Identity to my Web Api project (in VS 2013 + .Net 4.5.1) I get the following error in each valid or unvalid(request to none exist co

7条回答
  •  半阙折子戏
    2020-12-08 02:07

    I originally created the project with authentication, but then decided to disable it. I had to remove this in the WebApiConfig.cs file. Make sure you have this if you intend to enable authentication.

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

提交回复
热议问题