4

I have a click once application that uses Windows Auth to authenticate against WCF services. However I am trying to allow users to run this application at home via a VPN connection. The main issue here is that the DefaultNetworkCredentials aren't setup correctly.

I was hoping to detect if the user was AD connected by using

WindowsIdentity.GetCurrent().Name.StartsWith(@"{DOMAIN NAME}\", StringComparison.InvariantCultureIgnoreCase)

But after that I can't figure out how to impersonate the domain user whilst on a home machine...

4

1 回答 1

2

我认为你需要在用户层面解决这个问题,

C:\Windows\System32\runas.exe /netonly /user:\ "YOURAPPPATH"

尝试让他们从命令行像这样运行您的应用程序。(或者可能,安装包含一个看起来像这样的快捷方式)

他们每次运行时都需要重新输入域密码。

这里有更多关于 runas 的信息

于 2013-05-29T20:45:28.980 回答