3

I created authorize attribute in some controller. When my browser using jquery call this api to get data, it gets unauthorized 401 status code, my browser always show authencation popup. It is ugly. I think it can be resolved by remove WWW-Authenticate header? How do I remove it in Web API.

Thanks a lot!

PhuongTT
  • 335
  • 1
  • 8
  • 19
  • Possible duplicate of [How to prevent browser to invoke basic auth popup and handle 401 error using Jquery?](http://stackoverflow.com/questions/9859627/how-to-prevent-browser-to-invoke-basic-auth-popup-and-handle-401-error-using-jqu) – Ruud Helderman Feb 19 '16 at 15:52

1 Answers1

1

According to the HTTP specification, when responding with status code 401, the server MUST include a WWW-Authenticate header.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.htmt

Mike Goodwin
  • 8,810
  • 2
  • 35
  • 50