Guest User

Untitled

a guest
Jul 19th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&redirect_uri=https://my_url&response_type=code&client_id=xxxxx
  2.  
  3. require('google-api-php-client-2.2.2_PHP54/vendor/autoload.php');
  4. $client = new Google_Client(Constant::PARAMS);
  5. $client->setAccessType('offline');
  6. $client->setRedirectUri('https://my_url');
  7. $accessToken = $client->fetchAccessTokenWithAuthCode($_GET['code']);
  8.  
  9. https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&redirect_uri=https://my_url&response_type=code&client_id=xxxxx&state=https://my_url
  10.  
  11. require('google-api-php-client-2.2.2_PHP54/vendor/autoload.php');
  12. $client = new Google_Client(Constant::PARAMS);
  13. $client->setAccessType('offline');
  14. $client->setRedirectUri($_GET['state']);
  15. $accessToken = $client->fetchAccessTokenWithAuthCode($_GET['code']);
Add Comment
Please, Sign In to add comment