I am embarrassed that I\'m simply failing with an example piece of code, but I\'ll blame it on the fact that it is late...
I have taken a copy and paste of: https://deve
here is a working example of non-interactive auth for Google Non-interactive authorization with Google OAuth2 the problem is not in "web" tag in the client json, but rather in the fact that their example is for web authentication while their suggested way of generating credentials is for non-interactive "service account". they have multiple problems with their documentation.
Right, after some more research (asking a colleague/genius), I found the problem. Basically the GoogleClientSecrets
object was not being properly bound with the information from my client_secrets.json
file. This meant that during authentication, objects were null
resulting in the IllegalArgumentException
.
So the original file which looked like this:
{
"private_key_id": "zzz",
"private_key": "-----BEGIN PRIVATE KEY-----\nxyz\n-----END PRIVATE KEY-----\n",
"client_email": "1234@developer.gserviceaccount.com",
"client_id": "1wdfghyjmp.apps.googleusercontent.com",
"type": "service_account"
}
was edited to look like this:
{
"web" : {
"private_key_id": "zzz",
"private_key": "-----BEGIN PRIVATE KEY-----\nxyz\n-----END PRIVATE KEY-----\n",
"client_email": "1234@developer.gserviceaccount.com",
"client_id": "1wdfghyjmp.apps.googleusercontent.com",
"type": "service_account"
}
}
This allowed me to progress through the code with authentication.
Hope this helps.