How do I get the Current User identity for a VPN user in a Windows forms app?

后端 未结 1 804
暗喜
暗喜 2020-12-06 17:50

We\'re currently developing a Windows Smartclient that needs to authenticate users using their AD group membership.

We now have a requirement for some users to conne

1条回答
  •  萌比男神i
    2020-12-06 18:47

    If their computer is on the domain and they log in under their AD credentials, you're good. WindowsIdentity.GetCurrent() will return correctly. If you VPN into the network but not into AD, you're out of luck. Try running your program as the AD Account. If you authenticate properly in the "Run As" dialog, WindowsIdentity.GetCurrent() should be correct.

    0 讨论(0)
提交回复
热议问题