ActiveDirectory Current Username in ASP.NET

后端 未结 5 1629
[愿得一人]
[愿得一人] 2020-12-31 19:20

I\'m trying to get both ActiveDirectory and standard forms login working but one thing is stopping me. I can\'t get the name of the current windows user. The closest I\'ve g

5条回答
  •  醉梦人生
    2020-12-31 20:15

    The .Net apps I've written where I've used windows authentication I can still use User.Identity.Name to get the AD username. This usually includes the DC of course, and returns the users SAM Account name. I was not trying to implement both at the same time but User.Identity.Name for sure works separately

提交回复
热议问题