public void changePwd(String userId,String oldpwd,String newpwd) throws AMConsoleException {
  String[] params={userId,AMAdminConstants.ATTR_USER_OLD_PASSWORD};
  try {
    logEvent("ATTEMPT_MODIFY_IDENTITY_ATTRIBUTE_VALUE",params);
    AMIdentity amid=IdUtils.getIdentity(getUserSSOToken(),userId);
    amid.changePassword(oldpwd,newpwd);
    logEvent("SUCCEED_MODIFY_IDENTITY_ATTRIBUTE_VALUE",params);
  }
 catch (  SSOException e) {
    String strError=getErrorString(e);
    String[] paramsEx={userId,AMAdminConstants.ATTR_USER_OLD_PASSWORD,strError};
    logEvent("SSO_EXCEPTION_MODIFY_IDENTITY_ATTRIBUTE_VALUE",paramsEx);
    throw new AMConsoleException(strError);
  }
catch (  IdRepoException e) {
    String strError=getErrorString(e);
    String[] paramsEx={userId,AMAdminConstants.ATTR_USER_OLD_PASSWORD,strError};
    logEvent("IDM_EXCEPTION_MODIFY_IDENTITY_ATTRIBUTE_VALUE",paramsEx);
    throw new AMConsoleException(strError);
  }
}

public void changePwd ( String userId , String oldpwd , String newpwd ) throws AMConsoleException { String [ ] params = { userId , AMAdminConstants . ATTR_USER_OLD_PASSWORD } ; try { logEvent ( "ATTEMPT_MODIFY_IDENTITY_ATTRIBUTE_VALUE" , params ) ; AMIdentity amid = IdUtils . getIdentity ( getUserSSOToken ( ) , userId ) ; amid . changePassword ( oldpwd , newpwd ) ; logEvent ( "SUCCEED_MODIFY_IDENTITY_ATTRIBUTE_VALUE" , params ) ; } catch ( SSOException e ) { String strError = getErrorString ( e ) ; String [ ] paramsEx = { userId , AMAdminConstants . ATTR_USER_OLD_PASSWORD , strError } ; logEvent ( "SSO_EXCEPTION_MODIFY_IDENTITY_ATTRIBUTE_VALUE" , paramsEx ) ; throw new AMConsoleException ( strError ) ; } catch ( IdRepoException e ) { String strError = getErrorString ( e ) ; String [ ] paramsEx = { userId , AMAdminConstants . ATTR_USER_OLD_PASSWORD , strError } ; logEvent ( "IDM_EXCEPTION_MODIFY_IDENTITY_ATTRIBUTE_VALUE" , paramsEx ) ; throw new AMConsoleException ( strError ) ; } }
modifies user password after validating old password .
