[jboss-cvs] JBossAS SVN: r79328 - branches/JBPAPP_4_2_0_GA_CP/security/src/main/org/jboss/security/auth/login.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 9 23:10:18 EDT 2008


Author: mmoyses
Date: 2008-10-09 23:10:17 -0400 (Thu, 09 Oct 2008)
New Revision: 79328

Modified:
   branches/JBPAPP_4_2_0_GA_CP/security/src/main/org/jboss/security/auth/login/AuthenticationInfo.java
Log:
JBPAPP-1277: masked passwords/credentials from login modules

Modified: branches/JBPAPP_4_2_0_GA_CP/security/src/main/org/jboss/security/auth/login/AuthenticationInfo.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/security/src/main/org/jboss/security/auth/login/AuthenticationInfo.java	2008-10-10 03:08:39 UTC (rev 79327)
+++ branches/JBPAPP_4_2_0_GA_CP/security/src/main/org/jboss/security/auth/login/AuthenticationInfo.java	2008-10-10 03:10:17 UTC (rev 79328)
@@ -29,6 +29,8 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
+
+import javax.naming.Context;
 import javax.security.auth.AuthPermission;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.login.AppConfigurationEntry;
@@ -139,8 +141,13 @@
          while( iter.hasNext() )
          {
             Entry e = (Entry) iter.next();
-            buffer.append("name="+e.getKey());
-            buffer.append(", value="+e.getValue());
+            String name = (String) e.getKey();
+            String value = (String) e.getValue();
+            if (name.toLowerCase().equals("password") || name.toLowerCase().equals("bindcredential") 
+                  || name.toLowerCase().equals(Context.SECURITY_CREDENTIALS))
+               value = "****";
+            buffer.append("name="+name);
+            buffer.append(", value="+value);
             buffer.append("\n");
          }
       }




More information about the jboss-cvs-commits mailing list