/** * Each chain needs to fill this function with it's own actions. * This function contains the functionality of each chain. * * @param ConfigInterface $pConfig The configuration which is used to make the request. * @param InternalFactory $pInternalFactory The factory which is responsible for the internal object creation. * @return bool|stdClass true if the request has been processed, false otherwise */ protected function process(ConfigInterface $pConfig, InternalFactory $pInternalFactory) { if ($pConfig->getAuthenticationMethod() === Authenticate::AUTH_METHOD_HEADER_TOKEN) { return true; } return false; }
/** * Each chain needs to fill this function with it's own actions. * This function contains the functionality of each chain. * * @param ConfigInterface $pConfig The configuration which is used to make the request. * @param InternalFactory $pInternalFactory The factory which is responsible for the internal object creation. * @return bool|stdClass true if the request has been processed, false otherwise */ protected function process(ConfigInterface $pConfig, InternalFactory $pInternalFactory) { if ($pConfig->getAuthenticationMethod() !== Authenticate::AUTH_METHOD_TOKEN) { return false; } $token = $pConfig->getAuthenticationCredentials(); return json_decode($pInternalFactory->getGuzzleFactory()->getGuzzleHandler()->get('token/' . $token)->getBody()); }
/** * Each chain needs to fill this function with it's own actions. * This function contains the functionality of each chain. * * @param ConfigInterface $pConfig The configuration which is used to make the request. * @param InternalFactory $pInternalFactory The factory which is responsible for the internal object creation. * @return bool|stdClass true if the request has been processed, false otherwise */ protected function process(ConfigInterface $pConfig, InternalFactory $pInternalFactory) { if ($pConfig->getAuthenticationMethod() !== Authenticate::AUTH_METHOD_USER_CREDENTIALS) { return false; } $userCredentials = $pConfig->getAuthenticationCredentials(); $userSession = $pConfig->getSession(); $response = json_decode($pInternalFactory->getGuzzleFactory()->getGuzzleHandler()->get('user/logout/' . $userCredentials['username'] . '/' . $userSession)->getBody()); return $response; }