You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IllegalArgumentException being thrown when trying to authenticate with google sheets api #93
I had the same issue using the wrong credentials.json I have downloaded for a service account, created to access google sheets from a web application. I was banging my head until I discovered that I needed an OAuth credentials, set "Web Application" as application type json file that has been downloaded from google cloud console.
Activity
sqrrrl commentedon Dec 3, 2019
Check your client secrets file to make sure it's correct. Possible that you downloaded credentials in the wrong form.
That error indicates it's not in the expected format as isn't either for a server-side web app or installed (desktop) app. Corresponding code: https://github.com/googleapis/google-api-java-client/blob/master/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleClientSecrets.java
sqrrrl commentedon Jan 21, 2020
Ping @aeslami3574 -- please verify your credentials are the correct type. Otherwise will close issue as not reproducible.
cdolek commentedon Oct 15, 2020
I had the same issue using the wrong
credentials.jsonI have downloaded for a service account, created to access google sheets from a web application. I was banging my head until I discovered that I needed an OAuth credentials, set "Web Application" as application type json file that has been downloaded from google cloud console.My credentials file should looks like this:
Johnny850807 commentedon Apr 9, 2022
My workaround: Don't use the client secrets, instead, directly build the credentials.
Import this library
weehong-1 commentedon Jul 11, 2022
This is the most accurate answer until today.
Hopefully, more developers can see this.
velikanov commentedon Sep 15, 2022
Works like a charm!
If you see this - use this
THANK YOU @Johnny850807
Hey @google come on, update your docs!