/** * 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); }
/** * Verify grant type * @throws UnauthorizedClientException * @throws InvalidGrantTypeException */ protected function verifyGrantType() { $grantType = $this->input->getParameter(self::GRANT_TYPE_KEY); if (!$grantType) { throw new InvalidGrantTypeException(); } if (!$this->clientStorage->canUseGrantType($this->getClient()->getId(), $grantType)) { throw new UnauthorizedClientException(); } }