/** * Checks that the supplied credentials are valid for authentication * * @param identity * @param password * @return <tt>true</tt> if the credentials are valid * @throws ConnectorException */ protected boolean areCredentialsValid(Identity identity, char[] password) throws ConnectorException { try { final Object obj = ((Invocable) engine).invokeFunction("areCredentialsValid", identity, new String(password)); if(obj instanceof PasswordChangeRequiredException) { throw (PasswordChangeRequiredException)obj; } Boolean ok = (Boolean) obj; if (ok && identity.getPasswordStatus().getType().equals(PasswordStatusType.changeRequired)) { throw new PasswordChangeRequiredException(); } return ok; } catch (ScriptException e) { processScriptExecption(e); throw new ConnectorException("Failed script execution.", e); } catch (NoSuchMethodException e) { return super.areCredentialsValid(identity, password); } }