public boolean verifyUserPassword(final String username,final String clearTextPassword){
  if (clearTextPassword == null || clearTextPassword.isEmpty()) {
    _log.error("Login with blank password is not allowed");
    return false;
  }
  String encpassword=null;
  PropertyInfo props=null;
  try {
    props=_coordinatorClient.getPropertyInfo();
  }
 catch (  CoordinatorException e) {
    _log.error("Access local user properties failed",e);
    return false;
  }
  if (props == null) {
    _log.error("Access local user properties failed");
    return false;
  }
  encpassword=props.getProperty("system_" + username + "_encpassword");
  if (StringUtils.isBlank(encpassword)) {
    _log.error("No password set for user {} ",username);
    return false;
  }
  if (StringUtils.startsWith(encpassword,CRYPT_SHA_512)) {
    String hashedValue=Crypt.crypt(clearTextPassword,encpassword);
    return encpassword.equals(hashedValue);
  }
 else {
    String encryptedValue=encrypt(clearTextPassword);
    return encpassword.equals(encryptedValue);
  }
}

public boolean verifyUserPassword ( final String username , final String clearTextPassword ) { if ( clearTextPassword == null || clearTextPassword . isEmpty ( ) ) { _log . error ( "Login with blank password is not allowed" ) ; return false ; } String encpassword = null ; PropertyInfo props = null ; try { props = _coordinatorClient . getPropertyInfo ( ) ; } catch ( CoordinatorException e ) { _log . error ( "Access local user properties failed" , e ) ; return false ; } if ( props == null ) { _log . error ( "Access local user properties failed" ) ; return false ; } encpassword = props . getProperty ( "system_" + username + "_encpassword" ) ; if ( StringUtils . isBlank ( encpassword ) ) { _log . error ( "No password set for user {} " , username ) ; return false ; } if ( StringUtils . startsWith ( encpassword , CRYPT_SHA_512 ) ) { String hashedValue = Crypt . crypt ( clearTextPassword , encpassword ) ; return encpassword . equals ( hashedValue ) ; } else { String encryptedValue = encrypt ( clearTextPassword ) ; return encpassword . equals ( encryptedValue ) ; } }
verify that the user ' s password matches with the hashed and salted value stored . return false if user is not found .
