Blank page after user cancels basic authentication

六月ゝ 毕业季﹏ 提交于 2019-12-02 03:41:46

问题


I've googled a lot about the problem, but still did not find, why it is happening. When user cancels BASIC auth form in browser, blank page is appeared.

401 page is setup in Tomcat webapp, in Firebug i can see 401 Unauthorized.

Maybe some header is missing in response?

Please help! Thanks a lot in advance.

UPDATE I think, my post is not informative enough: there is also combination of BASIC auth together with Spring Kerberos auth, and when blank page is appeared, headers are:

WWW-Authenticate Negotiate Basic realm="MyRealm"


回答1:


Enabling Kerberos Authentication in Firefox. Setup params

  • network.negotiate-auth.delegation-uris;
  • network.negotiate-auth.trusted-uris;

to http:// for all http url`s




回答2:


You could try to add the error code customization to your web.xml.

<error-page>
  <error-code>401</error-code>
  <location>/errors/401.jsp</location>
</error-page>

This will allow you to properly handle the error and offer to the user an escape...

HIH



来源:https://stackoverflow.com/questions/13583682/blank-page-after-user-cancels-basic-authentication

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