1
votes

i am trying to authenticate using setAuthConfig(). But i recieved an error.

Fatal error: Uncaught exception 'Google_Exception' with message 'Invalid client secret JSON file.' in /var/www/myinvitebig.com/vendor/google/apiclient/src/Google/Client.php:171 Stack trace:

0 /var/www/myinvitebig.com/calsync.php(57): Google_Client->setAuthConfig('cli.json')

1 {main}

thrown in /var/www/myinvitebig.com/vendor/google/apiclient/src/Google/Client.php on line 171

My cli.json file is correct. Here is my code. Please suggest me what to do?

$client->setAuthConfig('cli.json');
$client->refreshToken($rToken);
$refreshToken = $client->getAccessToken();

echo "==>".$refreshToken;
1
Hi harish try this approach paste your json file code inside setAuthConfig() - Mrugank Dhimmar

1 Answers

1
votes

setAuthConfig("Paste Your JSON file's code")