Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- require('google-api-php-client-2.2.2_PHP54/vendor/autoload.php');
- $client = new Google_Client(Constant::PARAMS);
- $client->setAccessType('offline');
- $client->setRedirectUri('https://my_url');
- $accessToken = $client->fetchAccessTokenWithAuthCode($_GET['code']);
- 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
- require('google-api-php-client-2.2.2_PHP54/vendor/autoload.php');
- $client = new Google_Client(Constant::PARAMS);
- $client->setAccessType('offline');
- $client->setRedirectUri($_GET['state']);
- $accessToken = $client->fetchAccessTokenWithAuthCode($_GET['code']);
Add Comment
Please, Sign In to add comment