How do I get an ICredential object within my web application?
- I use Windows Authentication
I tried using the following code:
WindowsImpersonationContext securityContext =
Request.LogonUserIdentity.Impersonate();
After the last line of code both: CredentialCache.DefaultCredentials and CredentialCache.DefaultNetworkCredentials are still empty.
I know that the identity is right because the following property shows the right domain\user account I'm using:
Request.LogonUserIdentity.Name
=> "domain\user"
This is the authentication type of that object:
Request.LogonUserIdentity.AuthenticationType
=> "NTLM"