Aron
Aron

Reputation: 15772

Impersonation of a domain account outside of a domain

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...

Upvotes: 4

Views: 700

Answers (1)

Char George
Char George

Reputation: 104

I think you need to tackle this at the user level,

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

Try having them run your app like this from the command line. (Or possibly, with the installation include a shortcut that looks like that)

They'll need to re-enter the domain password each time they run.

Here's more info on runas here

Upvotes: 2

Related Questions