开发者

MVC obtaining active directory user name

开发者 https://www.devze.com 2023-01-25 06:45 出处:网络
How do you obtain the username of the logged in user with MVC2 in ASP.NET web forms I used to do it with:

How do you obtain the username of the logged in user with MVC2 in ASP.NET web forms I used to do it with:

User.Identity.Name

This works when I am te开发者_StackOverflow中文版sting on my local machine using visual studio but no longer works once the project is published to the test server.

Thanks


This turned out to be a setting on the Virtual Directory. The option "enable anonymous access" was selected. Once this was de-selected everything worked as expected.

0

精彩评论

暂无评论...
验证码 换一张
取 消