All children will need this to validate the passed inputs against our defined inputs

@param array $authParams
@param array $acceptableParams
@throws \Exception
559823
public function validateAuthParams(array $authParams, array $acceptableParams)
    {
        foreach ($authParams as $paramName=>$paramValue) {

            if (!isset($acceptableParams[$paramName])) {
                throw new \Exception(get_class().": Unacceptable authParam: {$paramName}");
            }

            // Try resolving to class method first, then try resolving to global function
            if (method_exists($this, $acceptableParams[$paramName])) {
                $validationPassed = $this->$acceptableParams[$paramName]($paramValue);
            }
            elseif (function_exists($acceptableParams[$paramName])) {
                $validationPassed = $acceptableParams[$paramName]($paramValue);
            }
            else {
                throw new \Exception(get_class().": authParam validator not found: {$paramName}");
            }

            if (!$validationPassed) {
                throw new \Exception(get_class().": Failed authParam validation: {$paramName}");
            }
        }
    }
1215613
private function _validateParameters ($params)
    {
        // 引数の有無
        if (! isset($params[0])) {
            throw new \Exception('生成するコマンド名を指定してください');
        }

        // 既に存在するかどうか
        $params[0] = ucfirst($params[0]);
        if (file_exists(GARNET.DS.'Command'.DS.$params[0].'.php')) {
            throw new \Exception($params[0].' コマンドは既に存在しています');
        }
    }
913116
protected function setParams(array $params) {
		parent::setParams($params);
		if($this->autoinc===true){
			$this->notNull=false;
		}
	}
1068090
protected void checkSupported(AuthType authType) {
    switch (authType) {
      case NOSASL:
      case SIMPLE:
      case CUSTOM:
        return;
      default:
        throw new RuntimeException("Authentication type not supported:" + authType.name());
    }
  }
351129
public function setAuthHeader($params)
    {
        if (is_array($params)) {
            $this->authHeader = $this->toHeader($params);
        } else {
            if (strpos($params, 'Authorization: ') !== false) {
                $params = str_replace('Authorization: ', '', $params);
            }

            $this->authHeader = $params;
        }
    }
26345
private function validateApiParameters($keys = null, $params = null)
    {
        // Assert API has defined an id/endpoint
        $this->assertApiId();

        // Assert API keys array structure is valid
        $this->assertKeysArrayValid($keys);

        // Assert keys array has minimum required optional parameters
        $this->assertKeysHasMinOptParams($keys, $params);

        // Assert and set authentication parameters from Auth object
        $params = $this->setAuthenticationParameters($keys, $params, 'req');
        $params = $this->setAuthenticationParameters($keys, $params, 'opt');

        // Assert required argument parameters exist (non-authentication)
        $this->assertReqParameters($keys, $params);

        // Remove extra parameters not defined in keys array
        $this->removeUnknownParameters($keys, $params);

        return $params;
    }
38523
public function deleteOAuthProvider($params)
    {
        if (is_string($params)) {
            $params = array('provider_consumer_key' => $params);
        } else {
            $params = $this->checkFilterParams($params, array('provider_consumer_key'), array('provider_consumer_key'));
            if ($params === false) {
                throw new \InvalidArgumentException("params array contains invalid parameters or misses required parameters");
            }
        }

        return $this->lastRequest->delete(null, 'oauth_providers/' . $params[ 'provider_consumer_key' ]);
    }
991759
public function auth()
    {
        // Ensure AUTH has not already been initiated.
        parent::auth();

        $this->_send('AUTH PLAIN');
        $this->_expect(334);
        $this->_send(base64_encode("\0" . $this->_username . "\0" . $this->_password));
        $this->_expect(235);
        $this->_auth = true;
    }
234142
private function checkRequiredParameters(array $names, array $params)
    {
        foreach ($names as $name) {
            $this->checkRequiredParameter($name, $params);
        }
    }
891786
private function _checkRequiredParams($requestParams, $requiredParams)
    {
        $missingParams = array();

        if ($requiredParams && is_array($requiredParams))
        {
            foreach ($requiredParams as $requiredParam)
            {
                if (!array_key_exists($requiredParam, $requestParams))
                {
                    // Covers special case: when ids is required, group_ids can be substituted
                    if ($requiredParam === "ids")
                    {
                        if (!array_key_exists("group_ids", $requestParams))
                        {
                            $missingParams[] = $requiredParam;
                        }
                    }
                    else
                    {
                        $missingParams[] = $requiredParam;
                    }
                }
            }
        }

        return $missingParams;
    }
865212
public function setParams(array $params = [])
    {
        if (isset($params['access_token'])) {
            $this->setAccessTokenFromParams($params['access_token']);
        }

        unset($params['access_token']);

        $params = $this->sanitizeFileParams($params);
        $this->dangerouslySetParams($params);

        return $this;
    }
407025
static void setAuthParams(String appKey, String desiredUid,
                              String[] alreadyAuthedUids, String webHost, String apiType) {
        setAuthParams(appKey, desiredUid, alreadyAuthedUids, null, null, null);
    }
290333
private function setAuthenticationParametersNoValidation($params = null)
    {
        // Return if authentication property not set
        if ($this->auth == null) {
            return $params;
        }

        // Set parameters for previously configured auth properties
        // Get property list from auth class
        $auth_refl = new \ReflectionClass($this->auth);
        $props = $auth_refl->getProperties(\ReflectionProperty::IS_PUBLIC);

        /*
         * Loop through property names to determine if configured in auth object.
         * Add to parameters if set and does not already exist.
         */
        foreach ($props as $prop) {
            $name = $prop->getName();
            if (isset($this->auth->$name)) {
                // Do not overwrite if parameter already included
                $key = $this->auth->getAuthKeyByVar($name);
                if (!isset($params[$key])) {
                    $params[$key] = $this->auth->$name;
                }
            }
        }

        return $params;
    }
1248293
protected void checkParamsForAuth(AUTH_REQUIREMENTS required) throws IOException {
    if (!clientSecretsFilename.isEmpty()) {
      File clientSecrets = new File(clientSecretsFilename);
      if (!clientSecrets.exists()) {
        throw new IOException(
            "Client secrets file " + clientSecretsFilename + " does not exist." +
            CLIENT_SECRETS_INSTRUCTIONS);   
      }
    } else {
     if (required == AUTH_REQUIREMENTS.CLIENT_SECRETS_ONLY) {
       throw new IOException(
           "Client secrets file has to be specified (API key can not be used)." 
               + CLIENT_SECRETS_INSTRUCTIONS); 
     }
     if (apiKey.isEmpty() && required != AUTH_REQUIREMENTS.NONE) {
       throw new IOException(
           "Either an API key or a client secrets file have to be specified." 
               + CLIENT_SECRETS_INSTRUCTIONS);
     }
    }
  }
1173629
private static function getNotAllowedParams($params, $allowedParams)
    {
        $notAllowedParams = array();
        foreach ($params as $key => $value) {
            if (!isset($allowedParams[$key])) {
                $notAllowedParams[$key] = $value;
            }
        }

        return $notAllowedParams;
    }
104725
static void setAuthParams(String appKey, String desiredUid,
                              String[] alreadyAuthedUids) {
        setAuthParams(appKey, desiredUid, alreadyAuthedUids, null);
    }
690147
public function auth() {

        try {
            $this->authResponse = $this->authAdapterInterface->authenticate();
        } catch (\Exception $ex) {
            throw $ex;
        }

        $message = $this->authResponse->getMessage();

        if ($message->getCode() == AuthResponse::AUTHRESPONSE_SUCCESS) {
            $this->session->set($message->getKeysession(), $message->getAttrsession());
        }

        return;
    }