Google authentication Error refreshing the OAuth2 token, message: '{ "error" : "invalid_client" }


Fatal error: Uncaught exception 'Google_Auth_Exception' with message 'Error refreshing the OAuth2 token, message: '{ "error" : "invalid_client", "error_description" : "The OAuth client was not found." }'' in H:\apinotes\programs\googleapi\analytis\google-api-php-client\src\Google\Auth\OAuth2.php:363 Stack trace: #0 H:\apinotes\programs\googleapi\analytis\google-api-php-client\src\Google\Auth\OAuth2.php(314): Google_Auth_OAuth2->refreshTokenRequest(Array) #1 H:\apinotes\programs\googleapi\analytis\customapi_class.php(33): Google_Auth_OAuth2->refreshTokenWithAssertion(Object(Google_Auth_AssertionCredentials)) #2 H:\apinotes\programs\googleapi\analytis\customapi_class.php(94): Customapi_class->getService() #3 H:\apinotes\programs\googleapi\analytis\index.php(6): Customapi_class->getSessonData() #4 {main} thrown in H:\apinotes\programs\googleapi\analytis\google-api-php-client\src\Google\Auth\OAuth2.php on line 363

My Code

include 'customapi_class.php';
$service_account_email = 'projectdemo@active-future-171705.iam.gserviceaccount.com';
$key_file_location = 'GoogleAnalytics-58c950b55b71.p12';
$analytics = new Customapi_class($service_account_email, $key_file_location);
$sessiondata = $analytics->getSessonData();
$realtimedata = $analytics->getRealtimeData();

 


24/06/2017 6:46:13 AM    William Johnson     Leave a Answers    Like    Add To Wishlist      

1 Answers


Leave an Answer


Leave A Reply