directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-core git commit: FC-194 - Change password represenation from a char[] to a String
Date Tue, 11 Oct 2016 01:45:19 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/master 0f1f5a7f3 -> 0a7af91bd


FC-194 - Change password represenation from a char[] to a String


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/0a7af91b
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/0a7af91b
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/0a7af91b

Branch: refs/heads/master
Commit: 0a7af91bd8fde554105e201cf4294fd893b0bd9a
Parents: 0f1f5a7
Author: Shawn McKinney <smckinney@apache.org>
Authored: Mon Oct 10 20:23:54 2016 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Mon Oct 10 20:23:54 2016 -0500

----------------------------------------------------------------------
 .../directory/fortress/core/ant/UserAnt.java    |  12 --
 .../core/cli/CommandLineInterpreter.java        |  10 +-
 .../directory/fortress/core/cli/Options.java    |  21 +---
 .../fortress/core/impl/AccessMgrImpl.java       |   2 +-
 .../fortress/core/impl/AdminMgrImpl.java        |   2 +-
 .../directory/fortress/core/impl/UserDAO.java   |   8 +-
 .../directory/fortress/core/impl/UserP.java     |   9 +-
 .../fortress/core/ldap/LdapDataProvider.java    |   6 +-
 .../directory/fortress/core/model/User.java     | 111 ++++++-------------
 .../fortress/core/rest/AccessMgrRestImpl.java   |   2 +-
 .../fortress/core/rest/AdminMgrRestImpl.java    |   4 +-
 .../fortress/core/AccelMgrConsole.java          |   2 +-
 .../fortress/core/AccessMgrConsole.java         |   4 +-
 .../fortress/core/AdminMgrConsole.java          |   8 +-
 .../core/DelegatedAccessMgrConsole.java         |   2 +-
 .../fortress/core/impl/AccelMgrImplTest.java    |   2 +-
 .../fortress/core/impl/AccessMgrImplTest.java   |  12 +-
 .../fortress/core/impl/AdminMgrImplTest.java    |   4 +-
 .../core/impl/PswdPolicyMgrImplTest.java        |  51 +++++----
 .../fortress/core/impl/UserTestData.java        |   4 +-
 .../core/impl/accelerator/TestAccelerator.java  |  16 +--
 .../core/jmeter/AccelCreateSession.java         |   2 +-
 .../fortress/core/jmeter/CheckAccess.java       |   2 +-
 .../core/jmeter/FortressCreateSession.java      |   2 +-
 .../core/jmeter/SessionPermissions.java         |   2 +-
 .../fortress/core/samples/AccessMgrSample.java  |  14 +--
 .../core/samples/CreateSessionSample.java       |  10 +-
 .../fortress/core/samples/CreateUserSample.java |   4 +-
 28 files changed, 127 insertions(+), 201 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/main/java/org/apache/directory/fortress/core/ant/UserAnt.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ant/UserAnt.java b/src/main/java/org/apache/directory/fortress/core/ant/UserAnt.java
index c58dd94..44ead7b 100755
--- a/src/main/java/org/apache/directory/fortress/core/ant/UserAnt.java
+++ b/src/main/java/org/apache/directory/fortress/core/ant/UserAnt.java
@@ -295,18 +295,6 @@ public class UserAnt extends User
     private String country;
 
     /**
-     * Generally not good practice to handle passwords as Strings in Java but this method allows Ant's digester to consume field in String format from the xml input file.
-     * It subsequently converts to char[] as needed by the parent entity - {@link User}.
-     *
-     * @param password String format will be converted to char[].
-     */
-    public void setPassword( String password )
-    {
-        super.setPassword( password.toCharArray() );
-    }
-
-
-    /**
      * Return phone for a user.
      *
      * @return String containing phone number.

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/main/java/org/apache/directory/fortress/core/cli/CommandLineInterpreter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/cli/CommandLineInterpreter.java b/src/main/java/org/apache/directory/fortress/core/cli/CommandLineInterpreter.java
index b8c8724..8a216d8 100755
--- a/src/main/java/org/apache/directory/fortress/core/cli/CommandLineInterpreter.java
+++ b/src/main/java/org/apache/directory/fortress/core/cli/CommandLineInterpreter.java
@@ -651,16 +651,16 @@ public class CommandLineInterpreter
                 command = CHANGE_PASSWORD;
                 LOG.info( command );
                 User user = options.getUser();
-                char[] newPassword = options.getNewPassword();
-                adminMgr.changePassword( user, newPassword );
+                String newPassword = options.getNewPassword();
+                adminMgr.changePassword( user, newPassword.toCharArray() );
             }
             else if ( commands.contains( RESET_PASSWORD ) )
             {
                 command = RESET_PASSWORD;
                 LOG.info( command );
                 User user = options.getUser();
-                char[] newPassword = options.getNewPassword();
-                adminMgr.resetPassword( user, newPassword );
+                String newPassword = options.getNewPassword();
+                adminMgr.resetPassword( user, newPassword.toCharArray() );
             }
             else if ( commands.contains( LOCK_USER_ACCOUNT ) )
             {
@@ -865,7 +865,7 @@ public class CommandLineInterpreter
                 command = AUTHENTICATE;
                 LOG.info( command );
                 User inUser = options.getUser();
-                Session session = accessMgr.authenticate( inUser.getUserId(), inUser.getPassword() );
+                Session session = accessMgr.authenticate( inUser.getUserId(), inUser.getPassword().toCharArray() );
                 printSession( session );
             }
             else if ( commands.contains( ASSIGNED_ROLES ) )

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/main/java/org/apache/directory/fortress/core/cli/Options.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/cli/Options.java b/src/main/java/org/apache/directory/fortress/core/cli/Options.java
index 9990a8d..8d414f8 100755
--- a/src/main/java/org/apache/directory/fortress/core/cli/Options.java
+++ b/src/main/java/org/apache/directory/fortress/core/cli/Options.java
@@ -21,7 +21,6 @@ package org.apache.directory.fortress.core.cli;
 
 import java.util.Vector;
 
-import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.GlobalIds;
 import org.apache.directory.fortress.core.model.Address;
 import org.apache.directory.fortress.core.model.AdminRole;
@@ -300,26 +299,14 @@ public class Options implements java.io.Serializable
         return (String) parser.getOptionValue(userId);
     }
 
-    public char[] getPassword()
+    public String getPassword()
     {
-        char[] pw = null;
-        String szPw = (String) parser.getOptionValue(password);
-        if (StringUtils.isNotEmpty(szPw))
-        {
-            pw = szPw.toCharArray();
-        }
-        return pw;
+        return (String) parser.getOptionValue(password);
     }
 
-    public char[] getNewPassword()
+    public String getNewPassword()
     {
-        char[] pw = null;
-        String szPw = (String) parser.getOptionValue(newPassword);
-        if ( StringUtils.isNotEmpty( szPw ))
-        {
-            pw = szPw.toCharArray();
-        }
-        return pw;
+        return (String) parser.getOptionValue(newPassword);
     }
 
     private void updateProperties(User user)

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/main/java/org/apache/directory/fortress/core/impl/AccessMgrImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/AccessMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/impl/AccessMgrImpl.java
index da81b8f..e1e8a32 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/AccessMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/AccessMgrImpl.java
@@ -95,7 +95,7 @@ public class AccessMgrImpl extends Manageable implements AccessMgr, Serializable
 
         // Determine if user valid.
         User user = userP.read( inUser, false );
-        user.setPassword( password );
+        user.setPassword( new String( password ) );
         user.setContextId( contextId );
         Session ftSess = userP.authenticate( user );
         ftSess.setUser( user );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/main/java/org/apache/directory/fortress/core/impl/AdminMgrImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/AdminMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/impl/AdminMgrImpl.java
index 5c62899..f6b94c8 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/AdminMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/AdminMgrImpl.java
@@ -221,7 +221,7 @@ public final class AdminMgrImpl extends Manageable implements AdminMgr, Serializ
         assertContext( CLS_NM, methodName, user, GlobalErrIds.USER_NULL );
         VUtil.assertNotNullOrEmpty( newPassword, GlobalErrIds.USER_PW_NULL, CLS_NM + "." + methodName );
         setEntitySession( CLS_NM, methodName, user );
-        user.setPassword( newPassword );
+        user.setPassword( new String( newPassword ) );
         userP.resetPassword( user );
     }
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
index 052dd95..e1cd221 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
@@ -245,9 +245,9 @@ final class UserDAO extends LdapDataProvider
 
             myEntry.add( SchemaConstants.SN_AT, entity.getSn() );
 
-            if( ArrayUtils.isNotEmpty( entity.getPassword() ))
+            if( StringUtils.isNotEmpty( entity.getPassword() ))
             {
-                myEntry.add( SchemaConstants.USER_PASSWORD_AT, new String( entity.getPassword() ) );
+                myEntry.add( SchemaConstants.USER_PASSWORD_AT, entity.getPassword() );
             }
             else if( !Config.getInstance().getBoolean( GlobalIds.USER_CREATION_PASSWORD_FIELD, false ) )
             {
@@ -359,10 +359,10 @@ final class UserDAO extends LdapDataProvider
                     entity.getOu() ) );
             }
 
-            if ( ArrayUtils.isNotEmpty( entity.getPassword() ) )
+            if ( StringUtils.isNotEmpty( entity.getPassword() ) )
             {
                 mods.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, SchemaConstants
-                    .USER_PASSWORD_AT, new String( entity.getPassword() ) ) );
+                    .USER_PASSWORD_AT, entity.getPassword() ) );
             }
 
             if ( StringUtils.isNotEmpty( entity.getDescription() ) )

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/main/java/org/apache/directory/fortress/core/impl/UserP.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/UserP.java b/src/main/java/org/apache/directory/fortress/core/impl/UserP.java
index 804bc2a..7c65c0d 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/UserP.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/UserP.java
@@ -25,7 +25,6 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GlobalIds;
@@ -800,9 +799,9 @@ final class UserP
                 VUtil.safeText( entity.getSn(), GlobalIds.SN_LEN );
             }
             // password is not required on user object but user cannot execute AccessMgr or DelAccessMgr methods w/out pw.
-            if ( ArrayUtils.isNotEmpty( entity.getPassword() ) )
+            if ( StringUtils.isNotEmpty( entity.getPassword() ) )
             {
-                VUtil.password( entity.getPassword() );
+                VUtil.safeText( entity.getPassword(), GlobalIds.PASSWORD_LEN );
             }
             // the OU attribute is required:
             if ( StringUtils.isEmpty( entity.getOu() ) )
@@ -837,9 +836,9 @@ final class UserP
             {
                 VUtil.safeText( entity.getSn(), GlobalIds.SN_LEN );
             }
-            if ( ArrayUtils.isNotEmpty( entity.getPassword() ) )
+            if ( StringUtils.isNotEmpty( entity.getPassword() ) )
             {
-                VUtil.password( entity.getPassword() );
+                VUtil.safeText( entity.getPassword(), GlobalIds.PASSWORD_LEN );
             }
             if ( StringUtils.isNotEmpty( entity.getOu() ) )
             {

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java b/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java
index 6f29f5d..383d525 100644
--- a/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java
+++ b/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java
@@ -71,8 +71,6 @@ import org.apache.directory.fortress.core.model.Relationship;
 import org.apache.directory.fortress.core.util.Config;
 import org.apache.directory.fortress.core.util.LdapUtil;
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -1183,13 +1181,13 @@ public abstract class LdapDataProvider
      * @return bindResponse contains the result of the operation.
      * @throws LdapException in the event of LDAP error.
      */
-    protected BindResponse bind( LdapConnection connection, String szUserDn, char[] password ) throws LdapException
+    protected BindResponse bind( LdapConnection connection, String szUserDn, String password ) throws LdapException
     {
         COUNTERS.incrementBind();
         Dn userDn = new Dn( szUserDn );
         BindRequest bindReq = new BindRequestImpl();
         bindReq.setDn( userDn );
-        bindReq.setCredentials( new String( password ) );
+        bindReq.setCredentials( password );
         bindReq.addControl( PP_REQ_CTRL );
         return connection.bind( bindReq );
     }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/main/java/org/apache/directory/fortress/core/model/User.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/model/User.java b/src/main/java/org/apache/directory/fortress/core/model/User.java
index 9aee894..1782561 100755
--- a/src/main/java/org/apache/directory/fortress/core/model/User.java
+++ b/src/main/java/org/apache/directory/fortress/core/model/User.java
@@ -67,7 +67,7 @@ import javax.xml.bind.annotation.XmlType;
  * <h4>User entity attribute usages include</h4>
  * <ul>
  *   <li>
- *     {@link #setPassword(char[])} must be set before calling 
+ *     {@link #setPassword(String)} must be set before calling
  *     {@link org.apache.directory.fortress.core.impl.AccessMgrImpl#authenticate} and 
  *     {@link org.apache.directory.fortress.core.impl.AccessMgrImpl#createSession(User, boolean)} (unless trusted).
  *   </li>
@@ -272,8 +272,8 @@ public class User extends FortEntity implements Constraint, Serializable
     private static final long serialVersionUID = 1L;
 
     private String userId;
-    private char[] password;
-    private char[] newPassword;
+    private String password;
+    private String newPassword;
     private String internalId;
     private List<UserRole> roles;
     private List<UserAdminRole> adminRoles;
@@ -404,14 +404,10 @@ public class User extends FortEntity implements Constraint, Serializable
      * @param userId   String validated using simple length test and optional regular expression, i.e. safe text.
      * @param password validated using simple length test and OpenLDAP password policies.
      */
-    public User( String userId, char[] password )
+    public User( String userId, String  password )
     {
         this.userId = userId;
-
-        if ( password != null )
-        {
-            this.password = password.clone();
-        }
+        this.password = password;
     }
 
 
@@ -422,15 +418,10 @@ public class User extends FortEntity implements Constraint, Serializable
      * @param password validated using simple length test and OpenLDAP password policies.
      * @param roleName contains role that caller is requesting activation.
      */
-    public User( String userId, char[] password, String roleName )
+    public User( String userId, String password, String roleName )
     {
         this.userId = userId;
-
-        if ( password != null )
-        {
-            this.password = password.clone();
-        }
-
+        this.password = password;
         setRole( new UserRole( roleName ) );
     }
 
@@ -442,14 +433,10 @@ public class User extends FortEntity implements Constraint, Serializable
      * @param password validated using simple length test and OpenLDAP password policies.
      * @param roleNames contains array of roleNames that caller is requesting activation.
      */
-    public User( String userId, char[] password, String[] roleNames )
+    public User( String userId, String password, String[] roleNames )
     {
         this.userId = userId;
-
-        if ( password != null )
-        {
-            this.password = password.clone();
-        }
+        this.password = password;
 
         if ( roleNames != null )
         {
@@ -469,15 +456,10 @@ public class User extends FortEntity implements Constraint, Serializable
      * @param roleName contains role that caller is requesting activation (see {@link org.apache.directory.fortress.core.AccessMgr#createSession(User, boolean)}) or assignment (see {@link org.apache.directory.fortress.core.AdminMgr#addUser(User)}).
      * @param ou org unit name that caller is requesting assigned to newly created User (see {@link org.apache.directory.fortress.core.AdminMgr#addUser(User)}).
      */
-    public User( String userId, char[] password, String roleName, String ou )
+    public User( String userId, String password, String roleName, String ou )
     {
         this.userId = userId;
-
-        if ( password != null )
-        {
-            this.password = password.clone();
-        }
-
+        this.password = password;
         setRole( new UserRole( roleName ) );
         this.ou = ou;
     }
@@ -860,24 +842,15 @@ public class User extends FortEntity implements Constraint, Serializable
 
 
     /**
-     * Return the optional password attribute for User.  Note this will only return values that were set by client
-     * as the Fortress User DAO class does not return the value of stored password to caller.
+     * Get the optional password attribute associated for a User.  Note, this value is required before User will pass Fortress
+     * authentication in {@link org.apache.directory.fortress.core.impl.AccessMgrImpl#createSession(User, boolean)}.
+     * Even though password is char[] format here it will be stored on the ldap server (using server-side controls) in configurable and standard hashed formats.
      *
-     * @return attribute containing User password.
+     * @return value maps to 'userPassword' attribute in 'inetOrgPerson' object class.
      */
-    public char[] getPassword()
+    public String getPassword()
     {
-        if ( password != null )
-        {
-            char[] copy = new char[password.length];
-            System.arraycopy( password, 0, copy, 0, password.length );
-
-            return copy;
-        }
-        else
-        {
-            return null;
-        }
+        return password;
     }
 
 
@@ -888,49 +861,31 @@ public class User extends FortEntity implements Constraint, Serializable
      *
      * @param password maps to 'userPassword' attribute in 'inetOrgPerson' object class.
      */
-    public void setPassword( char[] password )
+    public void setPassword(String password)
     {
-        if ( password != null )
-        {
-            // Copy the password
-            this.password = new char[password.length];
-            System.arraycopy( password, 0, this.password, 0, password.length );
-        }
-        else
-        {
-            this.password = null;
-        }
+        this.password = password;
     }
 
 
-    public char[] getNewPassword()
+    /**
+     * Get the new password which will be used in a password change.
+     *
+     * @return value maps to a new 'userPassword' attribute in 'inetOrgPerson' object class.
+     */
+    public String getNewPassword()
     {
-        if ( newPassword != null )
-        {
-            char[] copy = new char[newPassword.length];
-            System.arraycopy( newPassword, 0, copy, 0, newPassword.length );
-
-            return copy;
-        }
-        else
-        {
-            return null;
-        }
+        return newPassword;
     }
 
 
-    public void setNewPassword( char[] newPassword )
+    /**
+     * Set the new password which will be used in a password change.
+     *
+     * @param newPassword maps to a new 'userPassword' attribute in 'inetOrgPerson' object class.
+     */
+    public void setNewPassword(String newPassword)
     {
-        if ( newPassword != null )
-        {
-            // Copy the newPassword
-            this.newPassword = new char[newPassword.length];
-            System.arraycopy( newPassword, 0, this.newPassword, 0, newPassword.length );
-        }
-        else
-        {
-            this.newPassword = null;
-        }
+        this.newPassword = newPassword;
     }
 
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/main/java/org/apache/directory/fortress/core/rest/AccessMgrRestImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/AccessMgrRestImpl.java b/src/main/java/org/apache/directory/fortress/core/rest/AccessMgrRestImpl.java
index a9e6632..d5817aa 100644
--- a/src/main/java/org/apache/directory/fortress/core/rest/AccessMgrRestImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rest/AccessMgrRestImpl.java
@@ -86,7 +86,7 @@ public class AccessMgrRestImpl extends Manageable implements AccessMgr
         Session retSession;
         FortRequest request = new FortRequest();
         request.setContextId(this.contextId);
-        request.setEntity(new User(userId, password));
+        request.setEntity( new User( userId, new String ( password ) ) );
         String szRequest = RestUtils.marshal(request);
         String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.RBAC_AUTHN);
         FortResponse response = RestUtils.unmarshall(szResponse);

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/main/java/org/apache/directory/fortress/core/rest/AdminMgrRestImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/rest/AdminMgrRestImpl.java b/src/main/java/org/apache/directory/fortress/core/rest/AdminMgrRestImpl.java
index ec1f9e2..8d06bc5 100644
--- a/src/main/java/org/apache/directory/fortress/core/rest/AdminMgrRestImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/rest/AdminMgrRestImpl.java
@@ -204,7 +204,7 @@ public final class AdminMgrRestImpl extends Manageable implements AdminMgr
         VUtil.assertNotNullOrEmpty( newPassword, GlobalErrIds.USER_PW_NULL, CLS_NM + ".changePassword" );
         FortRequest request = new FortRequest();
         request.setContextId( this.contextId );
-        user.setNewPassword( newPassword );
+        user.setNewPassword( new String( newPassword ) );
         request.setEntity( user );
         if ( this.adminSess != null )
         {
@@ -281,7 +281,7 @@ public final class AdminMgrRestImpl extends Manageable implements AdminMgr
         VUtil.assertNotNullOrEmpty( newPassword, GlobalErrIds.USER_PW_NULL, CLS_NM + ".resetPassword" );
         FortRequest request = new FortRequest();
         request.setContextId( this.contextId );
-        user.setNewPassword( newPassword );
+        user.setNewPassword( new String( newPassword )  );
         request.setEntity( user );
         if ( this.adminSess != null )
         {

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/AccelMgrConsole.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/AccelMgrConsole.java b/src/test/java/org/apache/directory/fortress/core/AccelMgrConsole.java
index 5e1a3df..5f5941d 100644
--- a/src/test/java/org/apache/directory/fortress/core/AccelMgrConsole.java
+++ b/src/test/java/org/apache/directory/fortress/core/AccelMgrConsole.java
@@ -69,7 +69,7 @@ class AccelMgrConsole
             String userId = ReaderUtil.readLn();
             System.out.println("Enter password:");
             String password = ReaderUtil.readLn();
-            session = am.createSession(new User(userId, password.toCharArray()), false);
+            session = am.createSession(new User(userId, password), false);
             System.out.println("Session created successfully for userId [" + userId + "]");
             System.out.println("session [" + session + "]");
             System.out.println("ENTER to continue");

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/AccessMgrConsole.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/AccessMgrConsole.java b/src/test/java/org/apache/directory/fortress/core/AccessMgrConsole.java
index 837eeb0..055c770 100755
--- a/src/test/java/org/apache/directory/fortress/core/AccessMgrConsole.java
+++ b/src/test/java/org/apache/directory/fortress/core/AccessMgrConsole.java
@@ -163,7 +163,7 @@ class AccessMgrConsole
             String userId = ReaderUtil.readLn();
             System.out.println("Enter password:");
             String password = ReaderUtil.readLn();
-            session = am.createSession(new User(userId, password.toCharArray()), false);
+            session = am.createSession(new User(userId, password), false);
             System.out.println("Session created successfully for userId [" + userId + "]");
             System.out.println("session [" + session + "]");
             System.out.println("ENTER to continue");
@@ -215,7 +215,7 @@ class AccessMgrConsole
             else
             {
                 System.out.println("Enter password:");
-                user.setPassword(ReaderUtil.readLn().toCharArray());
+                user.setPassword(ReaderUtil.readLn());
             }
             System.out.println("Enter prop key (or NULL to skip):");
             String key = ReaderUtil.readLn();

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/AdminMgrConsole.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/AdminMgrConsole.java b/src/test/java/org/apache/directory/fortress/core/AdminMgrConsole.java
index 3e13735..bdcef2b 100755
--- a/src/test/java/org/apache/directory/fortress/core/AdminMgrConsole.java
+++ b/src/test/java/org/apache/directory/fortress/core/AdminMgrConsole.java
@@ -337,7 +337,7 @@ class AdminMgrConsole
             ue.setSn(sn);
             ue.setCn(cn);
             System.out.println("Enter pw");
-            ue.setPassword(ReaderUtil.readLn().toCharArray());
+            ue.setPassword(ReaderUtil.readLn());
             System.out.println("Enter User's description field");
             ue.setDescription(ReaderUtil.readLn());
             System.out.println("Enter organization unit, blank for default");
@@ -450,7 +450,7 @@ class AdminMgrConsole
             System.out.println("Enter userId");
             ue.setUserId(ReaderUtil.readLn());
             System.out.println("Enter pw");
-            ue.setPassword(ReaderUtil.readLn().toCharArray());
+            ue.setPassword(ReaderUtil.readLn());
 
             System.out.println("Do you want to test Admin User update - Y or N");
             String choice = ReaderUtil.readLn();
@@ -461,7 +461,7 @@ class AdminMgrConsole
                 System.out.println("Enter userId");
                 admin.setUserId(ReaderUtil.readLn());
                 System.out.println("Enter pw");
-                admin.setPassword(ReaderUtil.readLn().toCharArray());
+                admin.setPassword(ReaderUtil.readLn());
                 Session session = accessMgr.createSession(admin, false);
                 am.setAdmin(session);
             }
@@ -772,7 +772,7 @@ class AdminMgrConsole
             String oldPw = ReaderUtil.readLn();
             User user = new User();
             user.setUserId(userId);
-            user.setPassword(oldPw.toCharArray());
+            user.setPassword(oldPw);
             System.out.println("Enter new password");
             String newPw = ReaderUtil.readLn();
             am.changePassword(user, newPw.toCharArray());

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/DelegatedAccessMgrConsole.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/DelegatedAccessMgrConsole.java b/src/test/java/org/apache/directory/fortress/core/DelegatedAccessMgrConsole.java
index 482cc30..fc4ff11 100755
--- a/src/test/java/org/apache/directory/fortress/core/DelegatedAccessMgrConsole.java
+++ b/src/test/java/org/apache/directory/fortress/core/DelegatedAccessMgrConsole.java
@@ -170,7 +170,7 @@ class DelegatedAccessMgrConsole
             String password = ReaderUtil.readLn();
             session = new Session();
             //((AccessMgr)dAmgr).createSession(session, userId, password);
-            ( ( AccessMgr ) dAmgr ).createSession( new User( userId, password.toCharArray() ), false );
+            ( ( AccessMgr ) dAmgr ).createSession( new User( userId, password ), false );
             System.out.println( "Session created successfully for userId [" + userId + "]" );
             System.out.println( "session [" + session + "]" );
             System.out.println( "ENTER to continue" );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/impl/AccelMgrImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/impl/AccelMgrImplTest.java b/src/test/java/org/apache/directory/fortress/core/impl/AccelMgrImplTest.java
index a7910e5..308726b 100644
--- a/src/test/java/org/apache/directory/fortress/core/impl/AccelMgrImplTest.java
+++ b/src/test/java/org/apache/directory/fortress/core/impl/AccelMgrImplTest.java
@@ -120,7 +120,7 @@ public class AccelMgrImplTest extends TestCase
                 // now try negative test case:
                 try
                 {
-                    User userBad = new User( user.getUserId(), "badpw".toCharArray() );
+                    User userBad = new User( user.getUserId(), "badpw" );
                     accelMgr.createSession( userBad, false );
                     fail( CLS_NM + ".createSessions failed negative test" );
                 }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/impl/AccessMgrImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/impl/AccessMgrImplTest.java b/src/test/java/org/apache/directory/fortress/core/impl/AccessMgrImplTest.java
index 182b76d..cae87fa 100755
--- a/src/test/java/org/apache/directory/fortress/core/impl/AccessMgrImplTest.java
+++ b/src/test/java/org/apache/directory/fortress/core/impl/AccessMgrImplTest.java
@@ -127,7 +127,7 @@ public class AccessMgrImplTest extends TestCase
             for ( String[] usr : uArray )
             {
                 User user = UserTestData.getUser( usr );
-                Session session = accessMgr.authenticate( user.getUserId(), user.getPassword() );
+                Session session = accessMgr.authenticate( user.getUserId(), user.getPassword().toCharArray() );
                 assertNotNull( session );
                 String userId = accessMgr.getUserId( session );
                 assertTrue( "getUserIds failed compare found userId [" + userId + "] valid userId ["
@@ -208,7 +208,7 @@ public class AccessMgrImplTest extends TestCase
             for ( String[] usr : uArray )
             {
                 User user = UserTestData.getUser( usr );
-                Session session = accessMgr.authenticate( user.getUserId(), user.getPassword() );
+                Session session = accessMgr.authenticate( user.getUserId(), user.getPassword().toCharArray() );
                 assertNotNull( session );
                 // todo: need to test to ensure roles are not added to session.
                 // now try negative test case:
@@ -263,7 +263,7 @@ public class AccessMgrImplTest extends TestCase
                 // now try negative test case:
                 try
                 {
-                    accessMgr.authenticate( user.getUserId(), user.getPassword() );
+                    accessMgr.authenticate( user.getUserId(), user.getPassword().toCharArray() );
                     fail( CLS_NM + ".authenticateLockedUsers failed test" );
                 }
                 catch ( SecurityException se )
@@ -314,7 +314,7 @@ public class AccessMgrImplTest extends TestCase
                 // now try negative test case:
                 try
                 {
-                    accessMgr.authenticate( user.getUserId(), user.getPassword() );
+                    accessMgr.authenticate( user.getUserId(), user.getPassword().toCharArray() );
                     //accessMgr.authenticate( user.getUserId(), user.getPassword() );
                     fail( CLS_NM + ".authenticateResetUsers failed test" );
                 }
@@ -382,7 +382,7 @@ public class AccessMgrImplTest extends TestCase
                 // now try negative test case:
                 try
                 {
-                    User userBad = new User( user.getUserId(), "badpw".toCharArray() );
+                    User userBad = new User( user.getUserId(), "badpw" );
                     accessMgr.createSession( userBad, false );
                     fail( CLS_NM + ".createSessions failed negative test" );
                 }
@@ -1242,7 +1242,7 @@ public class AccessMgrImplTest extends TestCase
                 //Set<String> roles = dsd.getMembers().keySet();
                 Set<String> roles = dsd.getMembers();
                 User user = UserTestData.getUser( usr );
-                Session session = accessMgr.authenticate( user.getUserId(), user.getPassword() );
+                Session session = accessMgr.authenticate( user.getUserId(), user.getPassword().toCharArray() );
                 int j = 0;
                 for ( String role : roles )
                 {

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/impl/AdminMgrImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/impl/AdminMgrImplTest.java b/src/test/java/org/apache/directory/fortress/core/impl/AdminMgrImplTest.java
index 7699943..1097a8c 100755
--- a/src/test/java/org/apache/directory/fortress/core/impl/AdminMgrImplTest.java
+++ b/src/test/java/org/apache/directory/fortress/core/impl/AdminMgrImplTest.java
@@ -328,7 +328,7 @@ public class AdminMgrImplTest extends TestCase
             for ( String[] usr : uOldArray )
             {
                 User user = UserTestData.getUser( usr );
-                adminMgr.changePassword( user, UserTestData.getPassword( uNewArray[i++] ) );
+                adminMgr.changePassword( user, UserTestData.getPassword( uNewArray[i++] ).toCharArray() );
                 LOG.debug( "changePasswords user [" + user.getUserId() + "] successful" );
             }
         }
@@ -433,7 +433,7 @@ public class AdminMgrImplTest extends TestCase
             for ( String[] usr : uArray )
             {
                 User user = UserTestData.getUser( usr );
-                adminMgr.resetPassword( user, UserTestData.getPassword( usr ) );
+                adminMgr.resetPassword( user, UserTestData.getPassword( usr ).toCharArray() );
                 LOG.debug( "resetPasswords user [" + user.getUserId() + "] successful" );
             }
         }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/impl/PswdPolicyMgrImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/impl/PswdPolicyMgrImplTest.java b/src/test/java/org/apache/directory/fortress/core/impl/PswdPolicyMgrImplTest.java
index ef5bc06..044a36a 100755
--- a/src/test/java/org/apache/directory/fortress/core/impl/PswdPolicyMgrImplTest.java
+++ b/src/test/java/org/apache/directory/fortress/core/impl/PswdPolicyMgrImplTest.java
@@ -21,7 +21,6 @@ package org.apache.directory.fortress.core.impl;
 
 
 import java.lang.reflect.Array;
-import java.util.Arrays;
 import java.util.List;
 
 import junit.framework.Test;
@@ -195,12 +194,12 @@ public class PswdPolicyMgrImplTest extends TestCase
             oldUser.setPwPolicy( PolicyTestData.getName( plcy ) );
             adminMgr.updateUser( oldUser );
             TestUtils.sleep( PolicyTestData.getMinAge( plcy ) );
-            adminMgr.changePassword( UserTestData.getUser( oldusr ), UserTestData.getPassword( newusr ) );
+            adminMgr.changePassword( UserTestData.getUser( oldusr ), UserTestData.getPassword( newusr ).toCharArray() );
             User newUser = UserTestData.getUser( newusr );
             try
             {
-                newUser.setPassword( "changed".toCharArray() );
-                adminMgr.changePassword( UserTestData.getUser( newusr ), newUser.getPassword() );
+                newUser.setPassword( "changed" );
+                adminMgr.changePassword( UserTestData.getUser( newusr ), newUser.getPassword().toCharArray() );
                 fail( CLS_NM + ".minAge name [" + PolicyTestData.getName( plcy ) + "] user ["
                     + UserTestData.getUserId( oldusr ) + "] failed min age test" );
             }
@@ -210,7 +209,7 @@ public class PswdPolicyMgrImplTest extends TestCase
                     ex.getErrorId() == GlobalErrIds.PSWD_CONST_VIOLATION );
                 // still good
                 TestUtils.sleep( PolicyTestData.getMinAge( plcy ) );
-                adminMgr.changePassword( UserTestData.getUser( newusr ), newUser.getPassword() );
+                adminMgr.changePassword( UserTestData.getUser( newusr ), newUser.getPassword().toCharArray() );
             }
         }
         catch ( SecurityException ex )
@@ -262,8 +261,8 @@ public class PswdPolicyMgrImplTest extends TestCase
             User newUser = UserTestData.getUser( newusr );
             oldUser.setPwPolicy( PolicyTestData.getName( plcy ) );
             adminMgr.updateUser( oldUser );
-            char[] newPassword = newUser.getPassword();
-            adminMgr.changePassword( oldUser, newPassword );
+            String newPassword = newUser.getPassword();
+            adminMgr.changePassword( oldUser, newPassword.toCharArray() );
             oldUser.setPassword( newPassword );
             for ( int i = 0; i < 3; i++ )
             {
@@ -281,7 +280,7 @@ public class PswdPolicyMgrImplTest extends TestCase
                         + "]", ex.getErrorId() == GlobalErrIds.USER_PW_EXPIRED );
                     // still good
                 }
-                newPassword = "changedabc".toCharArray();
+                newPassword = "changedabc";
                 oldUser = new User( oldUser.getUserId() );
                 oldUser.setPassword( newPassword );
                 // since this password is now expired we have to call update rather than changePassword:
@@ -339,13 +338,13 @@ public class PswdPolicyMgrImplTest extends TestCase
             int numHistory = PolicyTestData.getInHistory( plcy );
             for ( int i = 0; i < numHistory + 1; i++ )
             {
-                String newPassword = Arrays.toString( UserTestData.getPassword( usr ) ) + Integer.toString( i );
-                LOG.debug( "inHistory change pw=" + Arrays.toString( user.getPassword() ) );
+                String newPassword = UserTestData.getPassword( usr ) + Integer.toString( i );
+                LOG.debug( "inHistory change pw=" + user.getPassword() );
                 adminMgr.changePassword( user, newPassword.toCharArray() );
-                user.setPassword( newPassword.toCharArray() );
+                user.setPassword( newPassword );
                 try
                 {
-                    LOG.debug( "inHistory change pw2=" + Arrays.toString( user.getPassword() ) );
+                    LOG.debug( "inHistory change pw2=" + user.getPassword() );
                     adminMgr.changePassword( user, newPassword.toCharArray() );
                 }
                 catch ( SecurityException ex )
@@ -358,7 +357,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             try
             {
                 // now try to change back to original password, this should pass
-                adminMgr.changePassword( user, UserTestData.getPassword( usr ) );
+                adminMgr.changePassword( user, UserTestData.getPassword( usr ).toCharArray() );
             }
             catch ( SecurityException ex )
             {
@@ -419,7 +418,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             try
             {
                 int min = PolicyTestData.getMinLength( plcy );
-                LOG.debug( "testMinLength min=" + min + " len pw=" + user.getPassword().length );
+                LOG.debug( "testMinLength min=" + min + " len pw=" + user.getPassword().length() );
                 String newPassword = new String( user.getPassword() ).substring( 0, min - 1 );
                 adminMgr.changePassword( user, newPassword.toCharArray() );
                 fail( CLS_NM + ".minLength name [" + PolicyTestData.getName( plcy ) + "] user ["
@@ -481,15 +480,15 @@ public class PswdPolicyMgrImplTest extends TestCase
             long expireSecs = PolicyTestData.getExpireWarning( plcy );
             long maxSecs = PolicyTestData.getMaxAge( plcy );
             long elapsedWait = maxSecs - expireSecs;
-            String newPassword = Arrays.toString( UserTestData.getPassword( usr ) ) + "a";
-            user.setPassword( newPassword.toCharArray() );
+            String newPassword = UserTestData.getPassword( usr ) + "a";
+            user.setPassword( newPassword );
             user.setPwPolicy( PolicyTestData.getName( plcy ) );
             // because the password max age is so short, need to set new password, otherwise it will have already expired:
             adminMgr.updateUser( user );
             // now do the password change to start the clock ticking:
-            newPassword = Arrays.toString( UserTestData.getPassword( usr ) ) + "b";
+            newPassword = UserTestData.getPassword( usr ) + "b";
             adminMgr.changePassword( user, newPassword.toCharArray() );
-            user.setPassword( newPassword.toCharArray() );
+            user.setPassword( newPassword );
             Session s1 = accessMgr.createSession( user, false );
             assertTrue( CLS_NM + ".expireWarning invalid error message userId [" + UserTestData.getUserId( usr ) + "]",
                 s1.getExpirationSeconds() == 0 );
@@ -556,9 +555,9 @@ public class PswdPolicyMgrImplTest extends TestCase
             User user = UserTestData.getUser( usr );
             user.setPwPolicy( PolicyTestData.getName( plcy ) );
             adminMgr.updateUser( user );
-            String newPassword = Arrays.toString( user.getPassword() ) + "a";
+            String newPassword = user.getPassword() + "a";
             adminMgr.changePassword( user, newPassword.toCharArray() );
-            user.setPassword( newPassword.toCharArray() );
+            user.setPassword( newPassword );
             TestUtils.sleep( PolicyTestData.getMaxAge( plcy ) );
             TestUtils.sleep( 1 );
             int numGrace = PolicyTestData.getGraceLoginLimit( plcy );
@@ -643,7 +642,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             {
                 try
                 {
-                    User badUser = new User( user.getUserId(), "wrongpw".toCharArray() );
+                    User badUser = new User( user.getUserId(), "wrongpw" );
                     accessMgr.createSession( badUser, false );
                     fail( CLS_NM + ".maxFailure name [" + PolicyTestData.getName( plcy ) + "] user ["
                         + UserTestData.getUserId( usr ) + "] failed max failure test=" + maxFailures + " iteration="
@@ -724,7 +723,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             {
                 try
                 {
-                    User badUser = new User( user.getUserId(), "wrongpw".toCharArray() );
+                    User badUser = new User( user.getUserId(), "wrongpw" );
                     accessMgr.createSession( badUser, false );
                     fail( CLS_NM + ".lockoutDuration name [" + PolicyTestData.getName( plcy ) + "] user ["
                         + UserTestData.getUserId( usr ) + "] failed lockout duration test=" + maxFailures
@@ -885,7 +884,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             {
                 try
                 {
-                    User badUser = new User( user.getUserId(), "wrongpw".toCharArray() );
+                    User badUser = new User( user.getUserId(), "wrongpw" );
                     accessMgr.createSession( badUser, false );
                     fail( CLS_NM + ".failureCountInterval name [" + PolicyTestData.getName( plcy ) + "] user ["
                         + UserTestData.getUserId( usr ) + "] failed failure count interval test, maxfailures="
@@ -909,7 +908,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             {
                 try
                 {
-                    User badUser = new User( user.getUserId(), "wrongpw".toCharArray() );
+                    User badUser = new User( user.getUserId(), "wrongpw" );
                     accessMgr.createSession( badUser, false );
                     fail( CLS_NM + ".failureCountInterval name [" + PolicyTestData.getName( plcy ) + "] user ["
                         + UserTestData.getUserId( usr ) + "] failed failure count interval test 2, maxfailures="
@@ -987,7 +986,7 @@ public class PswdPolicyMgrImplTest extends TestCase
                 try
                 {
                     // because mustchange flag is set, this better fail:
-                    User badUser = new User( user.getUserId(), "newpassword".toCharArray() );
+                    User badUser = new User( user.getUserId(), "newpassword" );
                     accessMgr.createSession( badUser, false );
                     fail( CLS_NM + ".mustChange name [" + PolicyTestData.getName( plcy ) + "] user ["
                         + UserTestData.getUserId( usr ) + "] failed must change test flag=" + mustChange );
@@ -1003,7 +1002,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             else
             {
                 // this better work:
-                User goodUser = new User( user.getUserId(), "newpassword".toCharArray() );
+                User goodUser = new User( user.getUserId(), "newpassword" );
                 accessMgr.createSession( goodUser, false );
             }
         }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/impl/UserTestData.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/impl/UserTestData.java b/src/test/java/org/apache/directory/fortress/core/impl/UserTestData.java
index 72e757e..fe66625 100755
--- a/src/test/java/org/apache/directory/fortress/core/impl/UserTestData.java
+++ b/src/test/java/org/apache/directory/fortress/core/impl/UserTestData.java
@@ -6430,9 +6430,9 @@ public class UserTestData extends TestCase
      * @param usr
      * @return
      */
-    public static char[] getPassword( String[] usr )
+    public static String getPassword( String[] usr )
     {
-        return usr[PASSWORD_COL].toCharArray();
+        return usr[PASSWORD_COL];
     }
 
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/impl/accelerator/TestAccelerator.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/impl/accelerator/TestAccelerator.java b/src/test/java/org/apache/directory/fortress/core/impl/accelerator/TestAccelerator.java
index c05da95..682dfbb 100644
--- a/src/test/java/org/apache/directory/fortress/core/impl/accelerator/TestAccelerator.java
+++ b/src/test/java/org/apache/directory/fortress/core/impl/accelerator/TestAccelerator.java
@@ -59,7 +59,7 @@ public class TestAccelerator
         LOG.info( "testSessionRoles..." );
         User user = new User();
         user.setUserId( "rbacuser1" );
-        user.setPassword( "secret".toCharArray() );
+        user.setPassword( "secret" );
         try
         {
             AccelMgr accelMgr = AccelMgrFactory.createInstance( TestUtils.getContext() );
@@ -85,7 +85,7 @@ public class TestAccelerator
             User user = new User();
             // positive test case:
             user.setUserId( "rbacuser1" );
-            user.setPassword( "secret".toCharArray() );
+            user.setPassword( "secret" );
             user.setRoleName( "rbacrole1" );
             user.setRoleName( "rbacrole2" );
             session = accelMgr.createSession( user, false );
@@ -95,7 +95,7 @@ public class TestAccelerator
             {
                 // negative test case:
                 user.setUserId( "rbacuser1" );
-                user.setPassword( "secretx".toCharArray() );
+                user.setPassword( "secretx" );
                 session = null;
                 session = accelMgr.createSession( user, false );
                 fail("failed negative createSession for rbacuser1");
@@ -122,7 +122,7 @@ public class TestAccelerator
         LOG.info( "testCheckAccess..." );
         User user = new User();
         user.setUserId( "rbacuser1" );
-        user.setPassword( "secret".toCharArray() );
+        user.setPassword( "secret" );
         //user.setRole( "rbacrole1" );
         //user.setRole( "rbacrole2" );
         Session session = null;
@@ -164,7 +164,7 @@ public class TestAccelerator
         LOG.info( "testDeleteSession..." );
         User user = new User();
         user.setUserId( "rbacuser1" );
-        user.setPassword( "secret".toCharArray() );
+        user.setPassword( "secret" );
         try
         {
             AccelMgr accelMgr = AccelMgrFactory.createInstance( TestUtils.getContext() );
@@ -190,7 +190,7 @@ public class TestAccelerator
             User user = new User();
             // positive test case:
             user.setUserId( "rbacuser1" );
-            user.setPassword( "secret".toCharArray() );
+            user.setPassword( "secret" );
             user.setRoleName( "rbacrole1" );
             //user.setRole( "rbacrole2" );
             session = accelMgr.createSession( user, false );
@@ -218,7 +218,7 @@ public class TestAccelerator
             User user = new User();
             // positive test case:
             user.setUserId( "rbacuser1" );
-            user.setPassword( "secret".toCharArray() );
+            user.setPassword( "secret" );
             //user.setRole( "rbacrole1" );
             //user.setRole( "rbacrole2" );
             session = accelMgr.createSession( user, false );
@@ -246,7 +246,7 @@ public class TestAccelerator
             User user = new User();
             // positive test case:
             user.setUserId( "rbacuser1" );
-            user.setPassword( "secret".toCharArray() );
+            user.setPassword( "secret" );
             session = accelMgr.createSession( user, false );
             // positive test case:
             Permission perm = new Permission();

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/jmeter/AccelCreateSession.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/jmeter/AccelCreateSession.java b/src/test/java/org/apache/directory/fortress/core/jmeter/AccelCreateSession.java
index 8dc2649..08f3a2a 100644
--- a/src/test/java/org/apache/directory/fortress/core/jmeter/AccelCreateSession.java
+++ b/src/test/java/org/apache/directory/fortress/core/jmeter/AccelCreateSession.java
@@ -67,7 +67,7 @@ public class AccelCreateSession extends AbstractJavaSamplerClient
             User user = new User();
             // positive test case:
             user.setUserId( userId );
-            user.setPassword( "secret".toCharArray() );
+            user.setPassword( "secret" );
             session = accelMgr.createSession( user, false );
             assertNotNull( session );
             assertTrue( session.isAuthenticated() );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/jmeter/CheckAccess.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/jmeter/CheckAccess.java b/src/test/java/org/apache/directory/fortress/core/jmeter/CheckAccess.java
index 5b8a90f..c3f37fb 100644
--- a/src/test/java/org/apache/directory/fortress/core/jmeter/CheckAccess.java
+++ b/src/test/java/org/apache/directory/fortress/core/jmeter/CheckAccess.java
@@ -178,7 +178,7 @@ public class CheckAccess extends AbstractJavaSamplerClient
                 String message;
                 User user = new User(userId);
                 // positive test case:
-                user.setPassword( "secret".toCharArray() );
+                user.setPassword( "secret" );
                 if( StringUtils.isNotEmpty( val ) && val.equals( "1" ))
                 {
                     message = "AC SETUP CreateSession, User: " + user.getUserId() + ", key: " + key + ", TID: " + getThreadId();

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/jmeter/FortressCreateSession.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/jmeter/FortressCreateSession.java b/src/test/java/org/apache/directory/fortress/core/jmeter/FortressCreateSession.java
index b85dbd8..f94b93e 100644
--- a/src/test/java/org/apache/directory/fortress/core/jmeter/FortressCreateSession.java
+++ b/src/test/java/org/apache/directory/fortress/core/jmeter/FortressCreateSession.java
@@ -67,7 +67,7 @@ public class FortressCreateSession extends AbstractJavaSamplerClient
             User user = new User();
             // positive test case:
             user.setUserId( userId );
-            user.setPassword( "secret".toCharArray() );
+            user.setPassword( "secret" );
             session = accessMgr.createSession( user, false );
             assertNotNull( session );
             assertTrue( session.isAuthenticated() );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/jmeter/SessionPermissions.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/jmeter/SessionPermissions.java b/src/test/java/org/apache/directory/fortress/core/jmeter/SessionPermissions.java
index 63be443..3b970c6 100644
--- a/src/test/java/org/apache/directory/fortress/core/jmeter/SessionPermissions.java
+++ b/src/test/java/org/apache/directory/fortress/core/jmeter/SessionPermissions.java
@@ -161,7 +161,7 @@ public class SessionPermissions extends AbstractJavaSamplerClient
                 String message;
                 User user = new User(userId);
                 // positive test case:
-                user.setPassword( "secret".toCharArray() );
+                user.setPassword( "secret" );
                 if( StringUtils.isNotEmpty( val ) && val.equals( "1" ))
                 {
                     message = "AC SETUP CreateSession, User: " + user.getUserId() + ", key: " + key + ", TID: " + getThreadId();

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/samples/AccessMgrSample.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/samples/AccessMgrSample.java b/src/test/java/org/apache/directory/fortress/core/samples/AccessMgrSample.java
index c787e37..c0e0293 100755
--- a/src/test/java/org/apache/directory/fortress/core/samples/AccessMgrSample.java
+++ b/src/test/java/org/apache/directory/fortress/core/samples/AccessMgrSample.java
@@ -98,7 +98,7 @@ public class AccessMgrSample extends TestCase
             // utility function will create an Fortress Session.  The Session contains the user's activated
             // roles along with other related attributes and status information (i.e. password status)
             Session session = createSession( CreateUserSample.TEST_USERID,
-                CreateUserSample.TEST_PASSWORD.toCharArray(), accessMgr );
+                CreateUserSample.TEST_PASSWORD, accessMgr );
             assertNotNull( session );
 
             for ( int i = 1; i < 6; i++ )
@@ -139,7 +139,7 @@ public class AccessMgrSample extends TestCase
             // utility function will create an Fortress Session.  The Session contains the user's activated
             // roles along with other related attributes and status information (i.e. password status)
             Session session = createSession( CreateUserSample.TEST_USERID,
-                CreateUserSample.TEST_PASSWORD.toCharArray(), accessMgr );
+                CreateUserSample.TEST_PASSWORD, accessMgr );
             assertNotNull( session );
             List<Permission> perms = accessMgr.sessionPermissions( session );
             assertNotNull( perms );
@@ -181,7 +181,7 @@ public class AccessMgrSample extends TestCase
             // utility function will create an Fortress Session.  The Session contains the user's activated
             // roles along with other related attributes and status information (i.e. password status)
             Session session = createSession( CreateUserSample.TEST_USERID,
-                CreateUserSample.TEST_PASSWORD.toCharArray(), accessMgr );
+                CreateUserSample.TEST_PASSWORD, accessMgr );
             // A null Session would be a bug and should never happen.  Fortress will throw a SecurityException if it cannot create.
             assertNotNull( session );
             // Get the activated Roles from the Session.
@@ -261,7 +261,7 @@ public class AccessMgrSample extends TestCase
             AccessMgr accessMgr = AccessMgrFactory.createInstance( TestUtils.getContext() );
             // Calling createSession and not setting any roles on User beforehand will attempt to activate all assigned Roles:
             Session session = createSession( CreateUserSample.TEST_USERID,
-                CreateUserSample.TEST_PASSWORD.toCharArray(), accessMgr );
+                CreateUserSample.TEST_PASSWORD, accessMgr );
             assertNotNull( session );
             // now, drop roles from User's Session one at a time:
             for ( int i = 1; i < 11; i++ )
@@ -294,7 +294,7 @@ public class AccessMgrSample extends TestCase
             // utility function will create an Fortress Session.  The Session contains the user's activated
             // roles along with other related attributes and status information (i.e. password status)
             Session session = createSession( CreateUserSample.TEST_USERID,
-                CreateUserSample.TEST_PASSWORD.toCharArray(), accessMgr );
+                CreateUserSample.TEST_PASSWORD, accessMgr );
             assertNotNull( session );
             User user = accessMgr.getUser( session );
             assertNotNull( user );
@@ -401,7 +401,7 @@ public class AccessMgrSample extends TestCase
      * @param password String contains case sensitive, clear text password field.
      * @return User RBAC Session that is used for subsequent AccessMgr API calls.
      */
-    private static Session createSession( String userId, char[] password, AccessMgr accessMgr )
+    private static Session createSession( String userId, String password, AccessMgr accessMgr )
     {
         String szLocation = ".createSession";
         Session session = null;
@@ -437,7 +437,7 @@ public class AccessMgrSample extends TestCase
      * @param activationRoles array of Role names targeted for activation into User's RBAC Session.
      * @return User RBAC Session that is used for subsequent AccessMgr API calls.
      */
-    private static Session createSession( String userId, char[] password, String[] activationRoles, AccessMgr accessMgr )
+    private static Session createSession( String userId, String password, String[] activationRoles, AccessMgr accessMgr )
     {
         String szLocation = ".createSession";
         Session session = null;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/samples/CreateSessionSample.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/samples/CreateSessionSample.java b/src/test/java/org/apache/directory/fortress/core/samples/CreateSessionSample.java
index 1ecd077..e1ea9c6 100755
--- a/src/test/java/org/apache/directory/fortress/core/samples/CreateSessionSample.java
+++ b/src/test/java/org/apache/directory/fortress/core/samples/CreateSessionSample.java
@@ -76,7 +76,7 @@ public class CreateSessionSample extends TestCase
     public void testCreateSession()
     {
         //createSession("oamuser1", "passw0rd1", 10);
-        createSession(CreateUserSample.TEST_USERID, CreateUserSample.TEST_PASSWORD.toCharArray(), 10);
+        createSession(CreateUserSample.TEST_USERID, CreateUserSample.TEST_PASSWORD, 10);
     }
 
     /**
@@ -86,7 +86,7 @@ public class CreateSessionSample extends TestCase
     public void testCreateSessionWithRole()
     {
         //createSessionsWithRole(CreateUserSample.TEST_USERID, CreateUserSample.TEST_PASSWORD, CreateRoleSample.TEST_SIMPLE_ROLE);
-        createSessionsWithRole(CreateUserSample.TEST_USERID, CreateUserSample.TEST_PASSWORD.toCharArray(), CreateRoleSample.TEST_ROLE_PREFIX + "1");
+        createSessionsWithRole(CreateUserSample.TEST_USERID, CreateUserSample.TEST_PASSWORD, CreateRoleSample.TEST_ROLE_PREFIX + "1");
     }
 
     /**
@@ -115,7 +115,7 @@ public class CreateSessionSample extends TestCase
      * @param password Password is case sensitive, clear text but is stored in directory as hashed value.
      * @param expectedRoles integer contains the expected number of Roles in the Session.
      */
-    public static void createSession(String userId, char[] password, int expectedRoles)
+    public static void createSession(String userId, String password, int expectedRoles)
     {
         String szLocation = ".createSession";
         try
@@ -146,7 +146,7 @@ public class CreateSessionSample extends TestCase
             try
             {
                 // this better fail
-                User userBad = new User(user.getUserId(), "badpw".toCharArray());
+                User userBad = new User(user.getUserId(), "badpw");
 
                 // The API will authenticate the User password, evaluate password policies and perform Role activations.
                 accessMgr.createSession(userBad, false);
@@ -179,7 +179,7 @@ public class CreateSessionSample extends TestCase
      * @param password Password is case sensitive, clear text but is stored in directory as hashed value.
      * @param role contains role name of Role targeted for Activation.
      */
-    public static void createSessionsWithRole(String userId, char[] password, String role)
+    public static void createSessionsWithRole(String userId, String password, String role)
     {
         String szLocation = ".createSessionsWithRole";
         try

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/0a7af91b/src/test/java/org/apache/directory/fortress/core/samples/CreateUserSample.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/samples/CreateUserSample.java b/src/test/java/org/apache/directory/fortress/core/samples/CreateUserSample.java
index b4e249a..941b7d9 100755
--- a/src/test/java/org/apache/directory/fortress/core/samples/CreateUserSample.java
+++ b/src/test/java/org/apache/directory/fortress/core/samples/CreateUserSample.java
@@ -86,7 +86,7 @@ public class CreateUserSample extends TestCase
          try
         {
             ReviewMgr reviewMgr = ReviewMgrFactory.createInstance(TestUtils.getContext());
-            User inUser = new User(TEST_USERID, TEST_PASSWORD.toCharArray());
+            User inUser = new User(TEST_USERID, TEST_PASSWORD);
             reviewMgr.readUser(inUser);
             // If we get here, the sample data needs to be removed:
         }
@@ -173,7 +173,7 @@ public class CreateUserSample extends TestCase
              */
             //User inUser = new User(TEST_USERID, TEST_PASSWORD, CreateRoleSample.TEST_SIMPLE_ROLE, CreateUserOrgSample.TEST_USER_OU_NM);
             //User inUser = new User(TEST_USERID, TEST_PASSWORD, CreateRoleSample.TEST_SIMPLE_ROLE, CreateUserOrgSample.TEST_USER_OU_NM);
-            User inUser = new User(TEST_USERID, TEST_PASSWORD.toCharArray());
+            User inUser = new User(TEST_USERID, TEST_PASSWORD);
             inUser.setOu(CreateUserOrgSample.TEST_USER_OU_NM);
             // Now call the add API.  The API will return User entity with associated LDAP dn if creation was successful.
 


Mime
View raw message