AngularJS Interceptor Never Catches 401 Error

风流意气都作罢 提交于 2019-12-06 14:22:40
ganders

Just remove the WWW-Authenticate header from the response before it gets back to your app. That's what fixed it for me.

handle 401 unauthorized error on windows Phone with Phonegap

Edit: The implementation that was used at my work was done at our F5 (load balancer) since that's where our Basic Authentication occurs.

Here's something I whipped up, that has NOT been tested. You could possibly place this in the Application_EndRequest method in Global.asax.cs file:

    if (context.Response.Headers.Contains("WWW-Authenticate"))
        context.Response.Headers.Remove("WWW-Authenticate");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!