DotCMIS: NtlmAuthenticationProvider improvements
git-svn-id: https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk@1427760 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/DotCMIS/binding/binding-intf.cs b/DotCMIS/binding/binding-intf.cs
index 1defdae..ad8c465 100644
--- a/DotCMIS/binding/binding-intf.cs
+++ b/DotCMIS/binding/binding-intf.cs
@@ -217,7 +217,18 @@
{
if (request != null)
{
- request.Credentials = CredentialCache.DefaultNetworkCredentials;
+ string user = GetUser();
+ string password = GetPassword();
+
+ if ((user == string.Empty || user == null) && (password == string.Empty || password == null))
+ {
+ request.Credentials = CredentialCache.DefaultNetworkCredentials;
+ }
+ else
+ {
+ request.Credentials = new NetworkCredential(user, password);
+ }
+
request.CookieContainer = Cookies;
request.AllowWriteStreamBuffering = true;
}