Why does HttpContext.Current.User.Identity.Name return blank

前端 未结 5 1490
攒了一身酷
攒了一身酷 2020-12-17 20:06

I created a site. It is an internal site. It is a .NET 4.0 site. I would like to grab the username using HttpContext.Current.User.Identity.Name of the person browsing the

5条回答
  •  渐次进展
    2020-12-17 20:38

    Yes, you do need, at least the

    
    

    part is required if you are using Integrated Windows Auth.

    After that, you should be able to grab the username of the person logged in.

    No, you don't need:

    
    

提交回复
热议问题