No OWIN authentication manager is associated with the request

If you are getting this error after adding swagger to your API project here is the solution to avoid this error:

In App_Start go to WebApiConfig.cs and comment the following line:

config.SuppressDefaultHostAuthentication();
config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));

Leave a Comment

Your email address will not be published. Required fields are marked *