Determine if browser supports windows integrated authentication

删除回忆录丶 提交于 2020-01-14 09:06:29

问题


Is there a way to determine if a browser supports NTLM without having NTLM enabled for the particular site or directory in IIS and without showing a login dialog/pop-up? Preferably, determine this using ColdFusion or perhaps some combination of JS and CF. I'd prefer not to restrict this to just IE as other browsers (such as FF) support NTLM authentication.


回答1:


If you request a page and the page returns 401 and says it only accepts NTLM, and then the browser sends another HTTP packet trying to respond to it, then it supports NTLM. You don't have to make IIS do this -- you could have any page where you can set the response codes and headers request NTLM. If you don't get another request, it means that the client couldn't authenticate this way.

You could detect this on the client by putting this request in an IFrame, then in the outer page checking to see what happened in the iframe.




回答2:


Building on Lou's answer, you could make a cfhttp request within a try/catch block. You then check the response headers to determine your next steps.




回答3:


Unfortunately, you may be forced to use browser sniffing and a white-list.



来源:https://stackoverflow.com/questions/1029329/determine-if-browser-supports-windows-integrated-authentication

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