Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Triger <kostat@mono-cvs.ximian.com>2005-10-30 15:06:11 +0300
committerKonstantin Triger <kostat@mono-cvs.ximian.com>2005-10-30 15:06:11 +0300
commit593afc18fe40654016cffa7aa470cb01dd7d159e (patch)
tree508cee206e4fa7ba6e9b3ce16bb98e327158fbf5 /mcs/class/Novell.Directory.Ldap
parent96a5645345f1a8ff31218e63a15e8b868a3a4500 (diff)
handle no credentials case
svn path=/trunk/mcs/; revision=52391
Diffstat (limited to 'mcs/class/Novell.Directory.Ldap')
-rw-r--r--mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/ChangeLog4
-rw-r--r--mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs9
2 files changed, 11 insertions, 2 deletions
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/ChangeLog b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/ChangeLog
new file mode 100644
index 00000000000..0b2f00d3f92
--- /dev/null
+++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/ChangeLog
@@ -0,0 +1,4 @@
+2005-10-30 Konstantin Triger <kostat@mainsoft.com>
+
+ * LdapConnection.cs: TARGET_JVM: if no credentials supplied,
+ try to login with current user credentials.
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs
index 5ae24c17383..70d960e90f9 100644
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs
+++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs
@@ -1592,8 +1592,13 @@ namespace Novell.Directory.Ldap
if ((authenticationTypes & AuthenticationTypes.Secure) != 0) {
LoginContext loginContext = null;
try {
- AuthenticationCallbackHandler callbackHandler = new AuthenticationCallbackHandler (username,password);
- loginContext = new LoginContext (SecurityAppName, callbackHandler);
+ if (username != null && password != null) {
+ AuthenticationCallbackHandler callbackHandler = new AuthenticationCallbackHandler (username,password);
+ loginContext = new LoginContext (SecurityAppName, callbackHandler);
+ }
+ else
+ loginContext = new LoginContext (SecurityAppName);
+
loginContext.login ();
}
catch (LoginException e) {