/** * Authenticate request data * @param IInput $input * @return bool|void * * @throws AuthenticationException */ protected function authRequestData(IInput $input) { $token = $this->oauthInput->getAuthorization(); if (!$token) { throw new AuthenticationException('Token was not found.'); } }
/** * Check presenter requirements * @param $element * @throws ForbiddenRequestException */ public function checkRequirements($element) { parent::checkRequirements($element); $accessToken = $this->input->getAuthorization(); if (!$accessToken) { throw new ForbiddenRequestException('Access token not provided'); } $this->checkAccessToken($accessToken); }