[Jboss-cvs] JBossAS SVN: r56255 - branches/JEE5_TCK/security/src/main/org/jboss/security/auth/spi

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Aug 25 07:17:28 EDT 2006


Author: dimitris at jboss.org
Date: 2006-08-25 07:17:25 -0400 (Fri, 25 Aug 2006)
New Revision: 56255

Modified:
   branches/JEE5_TCK/security/src/main/org/jboss/security/auth/spi/LdapExtLoginModule.java
Log:
JBAS-3555, allow anonymous login with no bindDN and bindCredential

Modified: branches/JEE5_TCK/security/src/main/org/jboss/security/auth/spi/LdapExtLoginModule.java
===================================================================
--- branches/JEE5_TCK/security/src/main/org/jboss/security/auth/spi/LdapExtLoginModule.java	2006-08-25 11:12:51 UTC (rev 56254)
+++ branches/JEE5_TCK/security/src/main/org/jboss/security/auth/spi/LdapExtLoginModule.java	2006-08-25 11:17:25 UTC (rev 56255)
@@ -481,8 +481,11 @@
          providerURL = "ldap://localhost:" + ((protocol != null && protocol.equals("ssl")) ? "636" : "389");
 
       env.setProperty(Context.PROVIDER_URL, providerURL);
-      env.setProperty(Context.SECURITY_PRINCIPAL, dn);
-      env.put(Context.SECURITY_CREDENTIALS, credential);
+      // JBAS-3555, allow anonymous login with no bindDN and bindCredential
+      if (dn != null)
+         env.setProperty(Context.SECURITY_PRINCIPAL, dn);
+      if (credential != null)
+         env.put(Context.SECURITY_CREDENTIALS, credential);
       traceLdapEnv(env);
       return new InitialLdapContext(env, null);
    }




More information about the jboss-cvs-commits mailing list