在我们的ASP.NET MVC应用程序,我们会自动通过将用户重定向到一个登录页面<authentication>的部分<system.web>,当他们试图访问授权,仅页面.问题是应用程序中间的一个操作(设计为由工具使用)需要在错误访问时返回直接的HTTP 401响应.如何在没有针对此特定操作的重定向的情况下返回真正的HTTP 401代码?
<authentication>
<system.web>
asp.net authentication asp.net-mvc forms-authentication
asp.net ×1
asp.net-mvc ×1
authentication ×1
forms-authentication ×1