【发布时间】:2016-08-06 05:36:24
【问题描述】:
我试图让 ASP.NET Core Identity 在用户未登录时返回 401。我在我的方法中添加了一个 [Authorize] 属性,而不是返回 401,而是返回 302。我已经尝试了大量建议,但似乎没有任何效果,包括 services.Configure 和 app.UseCookieAuthentication 将 LoginPath 设置为 null 或 PathString.Empty。
【问题讨论】:
-
对于其他追随此路线的人,我是从 devblog.dymel.pl/2016/07/07/… 来到这里的
标签: c# asp.net-core asp.net-core-identity