ASP.NET Forms Authentication With Only UserName

妖精的绣舞 提交于 2019-12-03 21:54:28

Set your web.config to use Forms Authentication.
Make sure Integrated Authentication is turned on in IIS (you may need to disable anonymous as well). This will allow you to get the user's NT name.

You can get the user's NT name with:

  Request.ServerVariables["LOGON_USER"]  

You can log the user in, no password needed, with:

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