/** * @param array $request_parameters * @param \OAuth2\Client\ClientInterface $client * * @throws \OAuth2\Exception\BadRequestExceptionInterface * * @return array */ private function getTokenTypeInformation(array $request_parameters, ClientInterface $client) { $token_type = $this->getTokenTypeFromRequest($request_parameters); if (!$client->isTokenTypeAllowed($token_type->getTokenTypeName())) { throw $this->getExceptionManager()->getBadRequestException(ExceptionManagerInterface::ERROR_INVALID_REQUEST, sprintf('The token type "%s" is not allowed for the client.', $token_type->getTokenTypeName())); } return $token_type->getTokenTypeInformation(); }