I'm trying to get ASP.NET Core Identity to return 401 when a user isn't logged in. I've added an [Authorize]
attribute to my method and instead of returning 401 it returns 302. I've tried a ton of suggestions but nothing seems to work, including services.Configure
and app.UseCookieAuthentication
setting LoginPath
to null
or PathString.Empty
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…