Authorization in ASP.NET Core. Always 401 Unauthorized for [Authorize] attribute
At the request of others here is the answer: The problem was with the middleware order in Startup.cs public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { ConfigureAuth(app); // your authorisation configuration app.UseMvc(); } Why middleware order is important? If we put app.UseMvc() first – then the MVC actions would get in the routing and …