LogonUserIdentity.Name vs. User.Identity.Name

末鹿安然 提交于 2019-12-04 09:05:14
Jagd

I found the answer on my own. The applicationhost.config for IIS Express was set to not allow windows authentication. I simply set enabled="true" and then User.Identity was no longer empty.

<windowsAuthentication enabled="true">
  <providers>
    <add value="Negotiate" />
    <add value="NTLM" />
  </providers>
</windowsAuthentication>

EDIT:
1) My apologies for the lack of information. I actually had the XML tags that I modified in my original answer, but I apparently forgot to mark them as being code by clicking on the Code Sample button, and so the XML tags were never displayed! They should be visible now.

2) The location of the applicationhost.config that I modified is down a few folders under My Documents. The exact location is: C:\Users[your user]\My Documents\IISExpress\config

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