[jboss-cvs] JBossAS SVN: r90860 - projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/auth/spi.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jul 6 15:24:21 EDT 2009


Author: mmoyses
Date: 2009-07-06 15:24:21 -0400 (Mon, 06 Jul 2009)
New Revision: 90860

Modified:
   projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/auth/spi/LdapExtLoginModule.java
Log:
SECURITY-422: allow {EXT} password in the bindCredential option

Modified: projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/auth/spi/LdapExtLoginModule.java
===================================================================
--- projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/auth/spi/LdapExtLoginModule.java	2009-07-06 19:20:07 UTC (rev 90859)
+++ projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/auth/spi/LdapExtLoginModule.java	2009-07-06 19:24:21 UTC (rev 90860)
@@ -24,6 +24,7 @@
 import java.security.Principal;
 import java.security.acl.Group;
 import java.util.Iterator;
+import java.util.Map;
 import java.util.Properties;
 import java.util.Map.Entry;
 
@@ -36,6 +37,8 @@
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
+import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.login.LoginException;
 
 import org.jboss.security.SimpleGroup;
@@ -199,6 +202,12 @@
    }
 
    private transient SimpleGroup userRoles = new SimpleGroup("Roles");
+   
+   public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
+   {
+      super.initialize(subject, callbackHandler, sharedState, options);
+      trace = log.isTraceEnabled();
+   }
 
    /**
     Overridden to return an empty password string as typically one cannot obtain a
@@ -319,6 +328,8 @@
    {
       bindDN = (String) options.get(BIND_DN);
       bindCredential = (String) options.get(BIND_CREDENTIAL);
+      if (bindCredential.startsWith("{EXT}"))
+         bindCredential = new String(org.jboss.security.Util.loadPassword(bindCredential));
       String securityDomain = (String) options.get(SECURITY_DOMAIN_OPT);
       if (securityDomain != null)
       {




More information about the jboss-cvs-commits mailing list