“Optional” windows integrated authentication for Internet Explorer

折月煮酒 提交于 2019-12-11 04:19:35

问题


I'm writing an ASP.NET (MVC 3) web app that's running in IIS 7. It will be accessed by intranet users, probably from the same Windows domain that the web server is in, and I'd like it to recognise the currently logged on Windows user whenever possible. However, I never want the browser to pop up the authentication dialog box. So, I want to use integrated authentication, but without bothering the user. If they're browsing in Firefox or their security settings don't allow automatic logon or whatever then just treat them as an anonymous user. Is there any way to do this?


回答1:


Not really. To enable integrated authentication, the server needs to send a header to the browser. Most browsers respond to this header in 1 of 2 ways. They'll either silently respond with the correct token, as IE does, or they'll prompt for credentials, as Firefox does or IE does if it can't generate the right token because integrated auth is off or it's on another domain.

You could detect FF and respond differently, but there is no way of detecting if IE has integrated auth switched off.



来源:https://stackoverflow.com/questions/6488865/optional-windows-integrated-authentication-for-internet-explorer

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