From 5c7f2f17f9c471d306955df457c7cab4e5c6ed3b Mon Sep 17 00:00:00 2001 From: Snap Date: Thu, 16 Apr 2015 14:51:26 -0700 Subject: Google's OpenID Connect method $google_client_id & $google_client_secret must be added to db.inc.php! --- .../tests/OAuthHelper.php | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 includes/google-api-php-client-master/tests/OAuthHelper.php (limited to 'includes/google-api-php-client-master/tests/OAuthHelper.php') diff --git a/includes/google-api-php-client-master/tests/OAuthHelper.php b/includes/google-api-php-client-master/tests/OAuthHelper.php new file mode 100644 index 0000000..1e36a4f --- /dev/null +++ b/includes/google-api-php-client-master/tests/OAuthHelper.php @@ -0,0 +1,45 @@ +setScopes( + array( + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/urlshortener", + "https://www.googleapis.com/auth/tasks", + "https://www.googleapis.com/auth/adsense", + "https://www.googleapis.com/auth/youtube" + ) +); +$client->setRedirectUri("urn:ietf:wg:oauth:2.0:oob"); +// Visit https://code.google.com/apis/console to +// generate your oauth2_client_id, oauth2_client_secret, and to +// register your oauth2_redirect_uri. +$client->setClientId(""); +$client->setClientSecret(""); + +$authUrl = $client->createAuthUrl(); + +`open '$authUrl'`; +echo "\nPlease enter the auth code:\n"; +$authCode = trim(fgets(STDIN)); + +$accessToken = $client->authenticate($authCode); + +echo "\n", 'Add the following to BaseTest.php as the $token value:', "\n\n"; +echo $accessToken, "\n\n"; -- cgit v1.2.3