You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by sm...@apache.org on 2016/10/11 03:07:09 UTC

directory-fortress-core git commit: FC-194 - pw2string on admin & access mgr method sigs

Repository: directory-fortress-core
Updated Branches:
  refs/heads/master 5a212b260 -> d581d6803


 FC-194 - pw2string on admin & access mgr method sigs


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/d581d680
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/d581d680
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/d581d680

Branch: refs/heads/master
Commit: d581d6803d0cffe80ce3963778b293b259e86633
Parents: 5a212b2
Author: Shawn McKinney <sm...@apache.org>
Authored: Mon Oct 10 21:45:41 2016 -0500
Committer: Shawn McKinney <sm...@apache.org>
Committed: Mon Oct 10 21:45:41 2016 -0500

----------------------------------------------------------------------
 .../directory/fortress/core/AccessMgr.java      |  4 +--
 .../directory/fortress/core/AdminMgr.java       |  4 +--
 .../core/cli/CommandLineInterpreter.java        |  6 ++--
 .../fortress/core/impl/AccessMgrImpl.java       |  4 +--
 .../fortress/core/impl/AdminMgrImpl.java        |  6 ++--
 .../directory/fortress/core/impl/UserDAO.java   |  4 +--
 .../directory/fortress/core/impl/UserP.java     |  2 +-
 .../fortress/core/rest/AccessMgrRestImpl.java   |  4 +--
 .../fortress/core/rest/AdminMgrRestImpl.java    |  8 +++---
 .../fortress/core/AccessMgrConsole.java         |  2 +-
 .../fortress/core/AdminMgrConsole.java          |  4 +--
 .../fortress/core/impl/AccessMgrImplTest.java   | 12 ++++----
 .../fortress/core/impl/AdminMgrImplTest.java    |  4 +--
 .../core/impl/PswdPolicyMgrImplTest.java        | 30 ++++++++++----------
 .../fortress/core/samples/AccessMgrSample.java  |  4 +--
 15 files changed, 49 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/src/main/java/org/apache/directory/fortress/core/AccessMgr.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/AccessMgr.java b/src/main/java/org/apache/directory/fortress/core/AccessMgr.java
index 51fff40..03cad31 100755
--- a/src/main/java/org/apache/directory/fortress/core/AccessMgr.java
+++ b/src/main/java/org/apache/directory/fortress/core/AccessMgr.java
@@ -78,7 +78,7 @@ public interface AccessMgr extends Manageable
      * @throws SecurityException
      *          in the event of data validation failure, security policy violation or DAO error.
      */
-    Session authenticate( String userId, char[] password )
+    Session authenticate( String userId, String password )
         throws SecurityException;
 
 
@@ -160,7 +160,7 @@ public interface AccessMgr extends Manageable
      * </h4>
      * <ul>
      * <li> roles that violate Dynamic Separation of Duty Relationships will not be activated into session.
-     * <li> role activations will proceed in same order as supplied to User entity setter, see {@link User#setRole(String)}.
+     * <li> role activations will proceed in same order as supplied to User entity setter, see {@link User#setRoleName(String)}.
      * </ul>
      *
      * @param user      Contains {@link User#userId}, {@link org.apache.directory.fortress.core.model.User#password} 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/src/main/java/org/apache/directory/fortress/core/AdminMgr.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/AdminMgr.java b/src/main/java/org/apache/directory/fortress/core/AdminMgr.java
index 12fbe81..0425bcb 100755
--- a/src/main/java/org/apache/directory/fortress/core/AdminMgr.java
+++ b/src/main/java/org/apache/directory/fortress/core/AdminMgr.java
@@ -242,7 +242,7 @@ public interface AdminMgr extends Manageable
      * @param newPassword contains new user password.
      * @throws SecurityException will be thrown in the event of password policy violation or system error.
      */
-    void changePassword( User user, char[] newPassword )
+    void changePassword( User user, String newPassword )
         throws SecurityException;
 
 
@@ -291,7 +291,7 @@ public interface AdminMgr extends Manageable
      * @param newPassword The new password to set
      * @throws SecurityException will be thrown in the event of pw policy violation or system error.
      */
-    void resetPassword( User user, char[] newPassword )
+    void resetPassword( User user, String newPassword )
         throws SecurityException;
 
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/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 8a216d8..78983cd 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
@@ -652,7 +652,7 @@ public class CommandLineInterpreter
                 LOG.info( command );
                 User user = options.getUser();
                 String newPassword = options.getNewPassword();
-                adminMgr.changePassword( user, newPassword.toCharArray() );
+                adminMgr.changePassword( user, newPassword );
             }
             else if ( commands.contains( RESET_PASSWORD ) )
             {
@@ -660,7 +660,7 @@ public class CommandLineInterpreter
                 LOG.info( command );
                 User user = options.getUser();
                 String newPassword = options.getNewPassword();
-                adminMgr.resetPassword( user, newPassword.toCharArray() );
+                adminMgr.resetPassword( user, newPassword );
             }
             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().toCharArray() );
+                Session session = accessMgr.authenticate( inUser.getUserId(), inUser.getPassword() );
                 printSession( session );
             }
             else if ( commands.contains( ASSIGNED_ROLES ) )

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/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 e1e8a32..eb7aa43 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
@@ -84,7 +84,7 @@ public class AccessMgrImpl extends Manageable implements AccessMgr, Serializable
      * {@inheritDoc}
      */
     @Override
-    public Session authenticate( String userId, char[] password )
+    public Session authenticate( String userId, String password )
         throws SecurityException
     {
         String methodName = "authenticate";
@@ -95,7 +95,7 @@ public class AccessMgrImpl extends Manageable implements AccessMgr, Serializable
 
         // Determine if user valid.
         User user = userP.read( inUser, false );
-        user.setPassword( new String( password ) );
+        user.setPassword( password );
         user.setContextId( contextId );
         Session ftSess = userP.authenticate( user );
         ftSess.setUser( user );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/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 f6b94c8..adcc0e5 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
@@ -175,7 +175,7 @@ public final class AdminMgrImpl extends Manageable implements AdminMgr, Serializ
      * {@inheritDoc}
      */
     @Override
-    public void changePassword( User user, char[] newPassword ) throws SecurityException
+    public void changePassword( User user, String newPassword ) throws SecurityException
     {
         String methodName = "changePassword";
         assertContext( CLS_NM, methodName, user, GlobalErrIds.USER_NULL );
@@ -215,13 +215,13 @@ public final class AdminMgrImpl extends Manageable implements AdminMgr, Serializ
      * {@inheritDoc}
      */
     @Override
-    public void resetPassword( User user, char[] newPassword ) throws SecurityException
+    public void resetPassword( User user, String newPassword ) throws SecurityException
     {
         String methodName = "resetPassword";
         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( new String( newPassword ) );
+        user.setPassword( newPassword );
         userP.resetPassword( user );
     }
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/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 e1cd221..480ad25 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
@@ -1472,7 +1472,7 @@ final class UserDAO extends LdapDataProvider
      * @throws SecurityException
      * @throws PasswordException
      */
-    boolean changePassword( User entity, char[] newPassword ) throws SecurityException
+    boolean changePassword( User entity, String newPassword ) throws SecurityException
     {
         boolean rc = true;
         LdapConnection ld = null;
@@ -1487,7 +1487,7 @@ final class UserDAO extends LdapDataProvider
             mods = new ArrayList<Modification>();
 
             mods.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, SchemaConstants
-                .USER_PASSWORD_AT, new String( newPassword ) ) );
+                .USER_PASSWORD_AT, newPassword ) );
 
             // This modify changes the password and checks password policies (if enabled)
             modify( ld, userDn, mods );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/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 7c65c0d..026916b 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
@@ -561,7 +561,7 @@ final class UserP
      * @param newPassword contains the new password which must pass the password policy constraints.
      * @throws SecurityException in the event of data validation failure, password policy violation or DAO error.
      */
-    void changePassword( User entity, char[] newPassword ) throws SecurityException
+    void changePassword( User entity, String newPassword ) throws SecurityException
     {
         String userId = entity.getUserId();
         boolean result = uDao.changePassword( entity, newPassword );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/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 d5817aa..006e7c7 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
@@ -78,7 +78,7 @@ public class AccessMgrRestImpl extends Manageable implements AccessMgr
      * {@inheritDoc}
      */
     @Override
-    public Session authenticate(String userId, char[] password)
+    public Session authenticate(String userId, String password)
         throws SecurityException
     {
         VUtil.assertNotNullOrEmpty(userId, GlobalErrIds.USER_ID_NULL, CLS_NM + ".authenticate");
@@ -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, new String ( password ) ) );
+        request.setEntity( new User( userId, 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/d581d680/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 8d06bc5..b6bdf96 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
@@ -197,14 +197,14 @@ public final class AdminMgrRestImpl extends Manageable implements AdminMgr
      * {@inheritDoc}
      */
     @Override
-    public void changePassword( User user, char[] newPassword )
+    public void changePassword( User user, String newPassword )
         throws SecurityException
     {
         VUtil.assertNotNull( user, GlobalErrIds.USER_NULL, CLS_NM + ".changePassword" );
         VUtil.assertNotNullOrEmpty( newPassword, GlobalErrIds.USER_PW_NULL, CLS_NM + ".changePassword" );
         FortRequest request = new FortRequest();
         request.setContextId( this.contextId );
-        user.setNewPassword( new String( newPassword ) );
+        user.setNewPassword( newPassword );
         request.setEntity( user );
         if ( this.adminSess != null )
         {
@@ -274,14 +274,14 @@ public final class AdminMgrRestImpl extends Manageable implements AdminMgr
      * {@inheritDoc}
      */
     @Override
-    public void resetPassword( User user, char[] newPassword )
+    public void resetPassword( User user, String newPassword )
         throws SecurityException
     {
         VUtil.assertNotNull( user, GlobalErrIds.USER_NULL, CLS_NM + ".resetPassword" );
         VUtil.assertNotNullOrEmpty( newPassword, GlobalErrIds.USER_PW_NULL, CLS_NM + ".resetPassword" );
         FortRequest request = new FortRequest();
         request.setContextId( this.contextId );
-        user.setNewPassword( new String( newPassword )  );
+        user.setNewPassword( newPassword );
         request.setEntity( user );
         if ( this.adminSess != null )
         {

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/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 055c770..a2a9132 100755
--- a/src/test/java/org/apache/directory/fortress/core/AccessMgrConsole.java
+++ b/src/test/java/org/apache/directory/fortress/core/AccessMgrConsole.java
@@ -141,7 +141,7 @@ class AccessMgrConsole
             String userId = ReaderUtil.readLn();
             System.out.println("Enter password:");
             String password = ReaderUtil.readLn();
-            session = am.authenticate(userId, password.toCharArray());
+            session = am.authenticate(userId, password);
             System.out.println("Authentication successful 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/d581d680/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 bdcef2b..63a7a4d 100755
--- a/src/test/java/org/apache/directory/fortress/core/AdminMgrConsole.java
+++ b/src/test/java/org/apache/directory/fortress/core/AdminMgrConsole.java
@@ -775,7 +775,7 @@ class AdminMgrConsole
             user.setPassword(oldPw);
             System.out.println("Enter new password");
             String newPw = ReaderUtil.readLn();
-            am.changePassword(user, newPw.toCharArray());
+            am.changePassword(user, newPw);
             System.out.println("userId [" + userId + "]");
             System.out.println("password has been changed");
             System.out.println("ENTER to continue");
@@ -799,7 +799,7 @@ class AdminMgrConsole
             user.setUserId(userId);
             System.out.println("Enter new password");
             String newPw = ReaderUtil.readLn();
-            am.resetPassword(user, newPw.toCharArray());
+            am.resetPassword(user, newPw);
             System.out.println("userId [" + userId + "]");
             System.out.println("password has been reset");
             System.out.println("ENTER to continue");

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/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 cae87fa..f8e0f29 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().toCharArray() );
+                Session session = accessMgr.authenticate( user.getUserId(), user.getPassword() );
                 assertNotNull( session );
                 String userId = accessMgr.getUserId( session );
                 assertTrue( "getUserIds failed compare found userId [" + userId + "] valid userId ["
@@ -208,13 +208,13 @@ public class AccessMgrImplTest extends TestCase
             for ( String[] usr : uArray )
             {
                 User user = UserTestData.getUser( usr );
-                Session session = accessMgr.authenticate( user.getUserId(), user.getPassword().toCharArray() );
+                Session session = accessMgr.authenticate( user.getUserId(), user.getPassword() );
                 assertNotNull( session );
                 // todo: need to test to ensure roles are not added to session.
                 // now try negative test case:
                 try
                 {
-                    accessMgr.authenticate( user.getUserId(), "wrongpw".toCharArray() );
+                    accessMgr.authenticate( user.getUserId(), "wrongpw" );
                     fail( "authenticateUsers failed negative test" );
                 }
                 catch ( SecurityException se )
@@ -263,7 +263,7 @@ public class AccessMgrImplTest extends TestCase
                 // now try negative test case:
                 try
                 {
-                    accessMgr.authenticate( user.getUserId(), user.getPassword().toCharArray() );
+                    accessMgr.authenticate( user.getUserId(), user.getPassword() );
                     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().toCharArray() );
+                    accessMgr.authenticate( user.getUserId(), user.getPassword() );
                     //accessMgr.authenticate( user.getUserId(), user.getPassword() );
                     fail( CLS_NM + ".authenticateResetUsers failed 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().toCharArray() );
+                Session session = accessMgr.authenticate( user.getUserId(), user.getPassword() );
                 int j = 0;
                 for ( String role : roles )
                 {

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/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 1097a8c..7699943 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++] ).toCharArray() );
+                adminMgr.changePassword( user, UserTestData.getPassword( uNewArray[i++] ) );
                 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 ).toCharArray() );
+                adminMgr.resetPassword( user, UserTestData.getPassword( usr ) );
                 LOG.debug( "resetPasswords user [" + user.getUserId() + "] successful" );
             }
         }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/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 044a36a..b9363de 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
@@ -194,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 ).toCharArray() );
+            adminMgr.changePassword( UserTestData.getUser( oldusr ), UserTestData.getPassword( newusr ) );
             User newUser = UserTestData.getUser( newusr );
             try
             {
                 newUser.setPassword( "changed" );
-                adminMgr.changePassword( UserTestData.getUser( newusr ), newUser.getPassword().toCharArray() );
+                adminMgr.changePassword( UserTestData.getUser( newusr ), newUser.getPassword() );
                 fail( CLS_NM + ".minAge name [" + PolicyTestData.getName( plcy ) + "] user ["
                     + UserTestData.getUserId( oldusr ) + "] failed min age test" );
             }
@@ -209,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().toCharArray() );
+                adminMgr.changePassword( UserTestData.getUser( newusr ), newUser.getPassword() );
             }
         }
         catch ( SecurityException ex )
@@ -262,7 +262,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             oldUser.setPwPolicy( PolicyTestData.getName( plcy ) );
             adminMgr.updateUser( oldUser );
             String newPassword = newUser.getPassword();
-            adminMgr.changePassword( oldUser, newPassword.toCharArray() );
+            adminMgr.changePassword( oldUser, newPassword );
             oldUser.setPassword( newPassword );
             for ( int i = 0; i < 3; i++ )
             {
@@ -340,12 +340,12 @@ public class PswdPolicyMgrImplTest extends TestCase
             {
                 String newPassword = UserTestData.getPassword( usr ) + Integer.toString( i );
                 LOG.debug( "inHistory change pw=" + user.getPassword() );
-                adminMgr.changePassword( user, newPassword.toCharArray() );
+                adminMgr.changePassword( user, newPassword );
                 user.setPassword( newPassword );
                 try
                 {
                     LOG.debug( "inHistory change pw2=" + user.getPassword() );
-                    adminMgr.changePassword( user, newPassword.toCharArray() );
+                    adminMgr.changePassword( user, newPassword );
                 }
                 catch ( SecurityException ex )
                 {
@@ -357,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 ).toCharArray() );
+                adminMgr.changePassword( user, UserTestData.getPassword( usr ) );
             }
             catch ( SecurityException ex )
             {
@@ -420,7 +420,7 @@ public class PswdPolicyMgrImplTest extends TestCase
                 int min = PolicyTestData.getMinLength( plcy );
                 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() );
+                adminMgr.changePassword( user, newPassword );
                 fail( CLS_NM + ".minLength name [" + PolicyTestData.getName( plcy ) + "] user ["
                     + UserTestData.getUserId( usr ) + "] failed length test" );
             }
@@ -487,7 +487,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             adminMgr.updateUser( user );
             // now do the password change to start the clock ticking:
             newPassword = UserTestData.getPassword( usr ) + "b";
-            adminMgr.changePassword( user, newPassword.toCharArray() );
+            adminMgr.changePassword( user, newPassword );
             user.setPassword( newPassword );
             Session s1 = accessMgr.createSession( user, false );
             assertTrue( CLS_NM + ".expireWarning invalid error message userId [" + UserTestData.getUserId( usr ) + "]",
@@ -556,7 +556,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             user.setPwPolicy( PolicyTestData.getName( plcy ) );
             adminMgr.updateUser( user );
             String newPassword = user.getPassword() + "a";
-            adminMgr.changePassword( user, newPassword.toCharArray() );
+            adminMgr.changePassword( user, newPassword );
             user.setPassword( newPassword );
             TestUtils.sleep( PolicyTestData.getMaxAge( plcy ) );
             TestUtils.sleep( 1 );
@@ -980,7 +980,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             User user = UserTestData.getUser( usr );
             policyMgr.updateUserPolicy( user.getUserId(), PolicyTestData.getName( plcy ) );
             boolean mustChange = PolicyTestData.getMustChange( plcy );
-            adminMgr.resetPassword( user, "newpassword".toCharArray() );
+            adminMgr.resetPassword( user, "newpassword" );
             if ( mustChange )
             {
                 try
@@ -1054,7 +1054,7 @@ public class PswdPolicyMgrImplTest extends TestCase
                 try
                 {
                     // because allowchange flag is false, this better fail:
-                    adminMgr.changePassword( user, "newPassword".toCharArray() );
+                    adminMgr.changePassword( user, "newPassword" );
                     fail( CLS_NM + ".allowUserChange name [" + PolicyTestData.getName( plcy ) + "] user ["
                         + UserTestData.getUserId( usr ) + "] failed allow change test flag=" + allowChange );
                 }
@@ -1070,7 +1070,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             else
             {
                 // this better work:
-                adminMgr.changePassword( user, "newPassword".toCharArray() );
+                adminMgr.changePassword( user, "newPassword" );
             }
         }
         catch ( SecurityException ex )
@@ -1122,7 +1122,7 @@ public class PswdPolicyMgrImplTest extends TestCase
                 try
                 {
                     // because safe modify flag is true, this better fail:
-                    adminMgr.changePassword( user, "newPassword".toCharArray() );
+                    adminMgr.changePassword( user, "newPassword" );
                     fail( CLS_NM + ".safeModify name [" + PolicyTestData.getName( plcy ) + "] user ["
                         + UserTestData.getUserId( usr ) + "] failed safe modify test flag=" + safeModify );
                 }
@@ -1137,7 +1137,7 @@ public class PswdPolicyMgrImplTest extends TestCase
             else
             {
                 // this better work:
-                adminMgr.changePassword( user, "newPassword".toCharArray() );
+                adminMgr.changePassword( user, "newPassword" );
             }
         }
         catch ( SecurityException ex )

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d581d680/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 c0e0293..08595fb 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
@@ -224,7 +224,7 @@ public class AccessMgrSample extends TestCase
             // Instantiate the AccessMgr implementation.
             AccessMgr accessMgr = AccessMgrFactory.createInstance( TestUtils.getContext() );
             // authenticate will check the password but will not activated any roles into Session.
-            Session session = authenticate( CreateUserSample.TEST_USERID, CreateUserSample.TEST_PASSWORD.toCharArray(),
+            Session session = authenticate( CreateUserSample.TEST_USERID, CreateUserSample.TEST_PASSWORD,
                 accessMgr );
             assertNotNull( session );
             // now, activate roles into User's Session one at a time:
@@ -472,7 +472,7 @@ public class AccessMgrSample extends TestCase
      * @param password String contains case sensitive, clear text password field.
      * @return User Session that has no Roles activated thus will fail checkAccess and sessionPermission calls.
      */
-    private static Session authenticate( String userId, char[] password, AccessMgr accessMgr )
+    private static Session authenticate( String userId, String password, AccessMgr accessMgr )
     {
         String szLocation = ".authenticate";
         Session session = null;