I'm building a server-side application that would need to authenticate with Google Spreadsheets API and read data from it. Using this PHP client with Google APIs client.
What I need to do is to authenticate with Google without user interaction.
Installed everything with composer and loaded with autoloader.php.
The problem I'm having is, in this section of the documentation, an $accessToken
variable is used which I can't generate. I created a project in Google Developers Console and oAuth 2.0 credentials with service account client ID. As a result, I got two files - JSON and p12
, alongside with the CLIENT ID
, EMAIL ADDRESS
and PUBLIC KEY FINGERPRINTS
credentials, which I don't know how to use to obtain the authorization token.
Also, I'm facing a redirect_uri_mismatch
error and I can't set it up in Google Developers Console.
The authenticate
method in OAuth2.php
is requiring a $code
variable which I don't have and don't know how to obtain.
If I could obtain that $accessToken
variable, I could try to debug further.
Any help is highly appreciated.