shubniggurath
shubniggurath

Reputation: 966

Impersonation in app.config

I have been handed a desktop application, written in vb. My task is to impersonate a given user for the entire application. This is the first desktop application I've ever touched - I'm a web developer.

In app.config, I have done something like this, under system.web

identity impersonate="true" userName="somedomain\someuser" password="somepassword"

She doesn't work. This works fine in a similar web.config file for a completely different web application. I returned WindowsIdentity.GetCurrent().Name in vb, which just gave me my own username and domain (same domain, if that matters at all).

What else do I need to do to get her to work, or what could I be doing wrong?

Thanks for your help!

Upvotes: 2

Views: 5535

Answers (1)

Mark Hall
Mark Hall

Reputation: 54552

You can take a look at the WindowsIdentity.Impersonate Method It has an example of how to Impersonate a user, it does use some Windows API Functions though. Also you can look at this Code Project Article.

Upvotes: 1

Related Questions