/** * @param \OAuth2\Client\ClientInterface $client * @param string $grant_type * * @throws \OAuth2\Exception\BaseExceptionInterface */ protected function checkGrantType(ClientInterface $client, $grant_type) { if (!$client->isAllowedGrantType($grant_type)) { throw $this->getExceptionManager()->getException(ExceptionManagerInterface::BAD_REQUEST, ExceptionManagerInterface::UNAUTHORIZED_CLIENT, 'The grant type "' . $grant_type . '" is unauthorized for this client_id'); } }