how do you use string from WWW-Authenticate header?
-
i'm trying to connect using HttpWebRequest class, but i'm getting a 401. i read in the documentation that i need to check the WWW-Authenticate header to see how to perform authentication. the info in the header is "Negotiate,NTLM". do i pass this string into the second param of CrendentialCache.Add()?
-
i'm trying to connect using HttpWebRequest class, but i'm getting a 401. i read in the documentation that i need to check the WWW-Authenticate header to see how to perform authentication. the info in the header is "Negotiate,NTLM". do i pass this string into the second param of CrendentialCache.Add()?
See the documentation for the Credentials Property[^] in the .NET Framework SDK for more information and an example. You don't need to handle the authentication headers yourself, merely pass an
ICredentials
implementation like theNetworkCredential
class. This can already handle basic, digest, HTLM, and kerberos authentication.Microsoft MVP, Visual C# My Articles