views:

332

answers:

1

This is related to this question which hasn’t had much success in the context of SharpSVN so I’m rephrasing in a pure .NET security context. I’m wondering if it’s possible to create a NetworkCredential object based on the current logged on user in an ASP.NET app without explicitly requesting username and password (it’s an integrated auth app).

There are plenty of examples around about doing this outside a web context (such as this one) but I can’t locate anything related to creating this object under the current HTTP context. In essence, I’m trying to automatically derive the following for the current user (which, by the way, works very well in hard coded fashion):

new NetworkCredential(@"aaa\bbb", "ccc")

Note: the examples out there referring to System.Net.CredentialCache.DefaultCredentials do not return the current user credentials in an HTTP context.

A: 
 var credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

Also does "HOW TO: Pass Current Credentials to an ASP.NET Web Service" Help

Preet Sangha
No luck Preet, the event log is reporting “Password Mismatch”. I suspect this would be the identity of the account the process is running under rather than that of the user in the current HTTP context.
Troy Hunt