0

I am trying to get refresh token for the authentication using Google_Client class. Here's how I am trying to do. using package "google/apiclient": "^2.2",

$client = new \Google_Client($config);
$client->setAccessType("offline"); 
$client->setState('offline');
$client->setApprovalPrompt('force');
$client->setIncludeGrantedScopes(true);
var_dump($client->authenticate('<auth_token_goes_here>');); // dumps array which has id_token, access_token , expires_in, token_type & created
var_dump($googleClient->getAccessToken()); // dumps array which has id_token, access_token , expires_in, token_type & created
var_dump($googleClient->getRefreshToken()); // returns null

What's wrong here?

Anand Siddharth
  • 967
  • 1
  • 9
  • 30
  • Alas! This StackOverflow post helped me https://stackoverflow.com/questions/10827920/not-receiving-google-oauth-refresh-token . – Anand Siddharth Apr 14 '18 at 22:33
  • hey. i am suing ur paytm package. i have done evrythng as u said. but wen i click the pay now button the page shows "transaction being processed" and then redirects me to a blank page like payment/api/status. why is it not taking me to paytm website? – Zubair Nazer Oliyat May 09 '18 at 18:09

0 Answers0