0

I have a kind of odd request- I have lots of users who run my application, and I need to be able to have the app know who is running it. This isn't a problem at all, and I am capturing this info just fine.

The trick is the application needs to access a network share that is restricted- none of the users running the app have permission to do anything there. And there's a lot of stuff going on there- reading files, writing, and since this is a WPF app, data binding to file URI's in that restricted area. To set ImageSource of an Image for example. In all different parts of the application, I need unrestricted access to that data.

I have been looking into the WindowsIdentity.Impersonation stuff, but it seems to be more targeted towards impersonating a user in a small context scope and then ending impersonation.. which is okay, but not convenient.

Is there a way to have my app start and then Impersonate a user within the app scope? So then I could do all the work with the correct permissions sets.

Nicros
  • 5,031
  • 12
  • 57
  • 101
  • @jeremywho the url shorthand syntax for comments is `[ text ]( url )` – Jeremy Thompson Jun 21 '13 at 01:21
  • @jeremywho I know you can, but if you read on past where I mentioned that I know about WindowsIdentity.Impersonation, I explain why the short lived context aspect of that isn't what I'm looking for. – Nicros Jun 21 '13 at 01:23

1 Answers1

0

One approach that might work is to set up a Windows service on the users machine that can connect to the server with appropriate Active Directory account privileges. Your application would communicate with that Windows service rather than to the server directly. While this might literally do what you want, the implementation may be more involved than you care to mess with.

Meredith Poor
  • 351
  • 2
  • 9
  • I thought about this- although I would have gone with a webserver to dish out files on request- but I think in either case it will be too slow :( – Nicros Jun 21 '13 at 05:22