Running the example examples/service-account.php, it ends with:
Fatal error: Uncaught exception 'Google_Auth_Exception' with message 'Error refreshing the OAuth2 token, message: ' in google/apiclient/src/Google/Auth/OAuth2.php on line 327
Google_Auth_Exception: Error refreshing the OAuth2 token, message: '{
"error" : "invalid_grant"
}' in google/apiclient/src/Google/Auth/OAuth2.php on line 327
Call Stack:
0.0020 262920 1. {main}() service-account:0
0.0155 3907760 2. Google_Auth_OAuth2->refreshTokenWithAssertion() service-account.php:77
0.0201 3913072 3. Google_Auth_OAuth2->refreshTokenRequest() google/apiclient/src/Google/Auth/OAuth2.php:289
It seems the error comes from a wrong variable name: I provided a wrong $client_id. Developers should use the Email address provided in the console instead of the client id
I'm getting the same error, but I didn't found the solution
Most helpful comment
I'm getting the same error, but I didn't found the solution