Get Windows Username from WCF server side

后端 未结 4 1270
孤街浪徒
孤街浪徒 2020-12-09 09:52

I\'m pretty green with web services and WCF, and I\'m using Windows integrated authentication - how do I get the username on the server-side interface? I believe that I\'m s

4条回答
  •  悲&欢浪女
    2020-12-09 10:11

    To get the WCF Service caller username:

    var callerUserName = ServiceSecurityContext.Current.WindowsIdentity.Name;

提交回复
热议问题