Google OAuth 2 client plugin for Drupal Authman

Composer is required for managing dependencies.

Usage Example

Example from YouTube API: https://developers.google.com/youtube/v3/docs/videos/list#common-use-cases

This example requires scope https://www.googleapis.com/auth/youtube.readonly.

/** @var \Drupal\authman\AuthmanInstance\AuthmanOauthFactoryInterface $factory */
$factory = \Drupal::service('authman.oauth');
$authmanInstance = $factory->get('foo');
try {
  $response = $authmanInstance->authenticatedRequest('GET', 'https://youtube.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&myRating=like');
  $successJson = \json_decode((string) $response->getBody());
}
catch (\GuzzleHttp\Exception\GuzzleException $e) {
  $errorJson = \json_decode((string) $e->getResponse()->getBody());
}
Supporting organizations: 

Project information

  • Module categories: Integrations
  • Ecosystem: Authman
  • Created by dpi on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    There are currently no supported stable releases.

Releases