I am able to get a response when I put my domain username and password as plain text into the request's Credentials member, but of course I'd like to avoid having that information in the application.
I thought that code along these lines (found at http://claytonj.wordpress.com/2006/0...-user-context/)
would solve my problem:
Expand|Select|Wrap|Line Numbers
- using System.Security.Principal;
- if (User.GetType() == typeof(WindowsPrincipal))
- {
- WindowsIdentity id = (WindowsIdentity) User.Identity;
- WindowsImpersonationContext impersonate = id.Impersonate();
- //perform tasks under the impersonated user
- //*** ***//
- //revert back to local ASPNET account
- impersonate.Undo();
- }
- else
- {
- //user isn’t authenticated
- }
My Question: What do I need to configure in order to get the ImpersonationLevel property to be of the TokenImpersonationLevel.Delegation type?
Let me know if this requires clarification.