Get the computer user name in a web application

Deadly 提交于 2020-01-15 04:44:24

问题


I have a web application where forms authentication is used. The user names are the same that the ones used by the users in their computers, so they want the web app to be able to detect that user name so the app can log it the user automatically.

How can it be done? I mean, if I set the authentication mode to "Form" do I still get those credentials from IIS?

I know this can be done in several better ways than this, but I am interested in this particular way. As it is a small web app in an intranet with a few users doesn't worth it a big architectural change. If it's possible, happy days, otherwise it will have to wait.

Cheers.


回答1:


That cannot be done with Forms Authentication. Without prompting the client for credentials, there is no way to retrieve that information from the client's machine.




回答2:


Windows auth cannot coexists with Forms auth, but it can coexists with Anonymous auth.

More info here: Windows authentication is not challenging browsers out of the domain



来源:https://stackoverflow.com/questions/7245270/get-the-computer-user-name-in-a-web-application

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