handle no credentials case
authorKonstantin Triger <kostat@mono-cvs.ximian.com>
Sun, 30 Oct 2005 12:06:11 +0000 (12:06 -0000)
committerKonstantin Triger <kostat@mono-cvs.ximian.com>
Sun, 30 Oct 2005 12:06:11 +0000 (12:06 -0000)
svn path=/trunk/mcs/; revision=52391

mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/ChangeLog [new file with mode: 0644]
mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs

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 (file)
index 0000000..0b2f00d
--- /dev/null
@@ -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.
index 5ae24c173839d89e29cd2a677c92f4a20907a40e..70d960e90f914ecbae8aff5a7e42ab5ae7e06f89 100644 (file)
@@ -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) {