I\'m writing some code to utilise a 3rd party component, and I need to supply an object which implements ICredentials when I start to use it.
If I write the following...
Have you tried setting the principalpolicy for the appdomain at the start of the application?
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
Setting this value before accessing the current principal object via the thread makes sure the windows identity is used in this object.
edit - I'm pretty sure this works for DefaultNetworkCredentials. I used it to access a web service with windows authentication from a windows forms app.