diff options
Diffstat (limited to 'mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs')
-rw-r--r-- | mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs | 9 |
1 files changed, 7 insertions, 2 deletions
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) { |