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
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.