/**
  * @param \OAuth2\Client\ClientInterface $client
  * @param string                         $grant_type
  *
  * @throws \OAuth2\Exception\BaseExceptionInterface
  */
 private function checkGrantType(ClientInterface $client, $grant_type)
 {
     if (!$client->isGrantTypeAllowed($grant_type)) {
         throw $this->getExceptionManager()->getBadRequestException(ExceptionManagerInterface::ERROR_UNAUTHORIZED_CLIENT, sprintf('The grant type "%s" is unauthorized for this client.', $grant_type));
     }
 }