После попытки включить owin и AspNet Identity в мой проект Web Api (в VS 2013 + .Net 4.5.1) я получаю следующую ошибку в каждом действительном или недействительном (запрос на отсутствие контроллера) запросах:
An error has occurred.
No OWIN authentication manager is associated with the request.
System.InvalidOperationException
at System.Web.Http.Owin.PassiveAuthenticationMessageHandler.SuppressDefaultAuthenticationChallenges(HttpRequestMessage request) at System.Web.Http.Owin.PassiveAuthenticationMessageHandler.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at System.Web.Http.HttpServer.d__0.MoveNext()
Как я проверил в режиме отладки, исключения также не обрабатываются! Также я понял, что класс Configuration в Startup никогда не вызывается (действительно никогда не перехватывается отладчиком). вот код для запуска:
[assembly: OwinStartup(typeof(bloob.bloob.Startup))]
namespace bloob.bloob
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/210 ... he-request