Esempio n. 1
0
 /**
  * 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.');
     }
 }
Esempio n. 2
0
 /**
  * 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);
 }