开发者

how do you capture httpcontext user information in your controller code when using visual studio

开发者 https://www.devze.com 2022-12-17 07:38 出处:网络
i asked this question which allowed me to capture user by using: string userName = this.HttpContext.User.Identity.Name;

i asked this question which allowed me to capture user by using:

string userName = this.HttpContext.User.Identity.Name;

in my controller code.

One issue i have is that wh开发者_运维百科en testing in visual studio it shows up as an empty string. I want to track this field for my testing.

Is there anyway to have this work in the local ASP.net webserver process on my machine so it it will mimic windows authentication on my server ??


Run application under IIS and set windows authentication in web.config.

    <authentication mode="Windows">
0

精彩评论

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

关注公众号