Example #1
0
 /**
  * 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();
     }
 }
Example #2
0
 /**
  * On presenter startup
  */
 protected function startup()
 {
     parent::startup();
     $this->client = $this->clientStorage->getClient($this->getParameter(GrantType::CLIENT_ID_KEY), $this->getParameter(GrantType::CLIENT_SECRET_KEY));
 }