Improved Web Services NTML authentication
git-svn-id: https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk@1482749 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/DotCMIS/binding/binding-intf.cs b/DotCMIS/binding/binding-intf.cs
index dc6e722..0602883 100644
--- a/DotCMIS/binding/binding-intf.cs
+++ b/DotCMIS/binding/binding-intf.cs
@@ -247,7 +247,18 @@
htbe.AuthenticationScheme = AuthenticationSchemes.Negotiate;
clientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Delegation;
- clientCredentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
+
+ string user = GetUser();
+ string password = GetPassword();
+
+ if ((user == string.Empty || user == null) && (password == string.Empty || password == null))
+ {
+ clientCredentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
+ }
+ else
+ {
+ clientCredentials.Windows.ClientCredential = new NetworkCredential(user, password);
+ }
}
}
}