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
Gmail API Java Quickstart Exception checkArgument(Preconditions.java:131) #220
Task :run FAILED
Exception in thread "main" java.lang.IllegalArgumentException
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:131)
at com.google.api.client.util.Preconditions.checkArgument(Preconditions.java:35)
at com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets.getDetails(GoogleClientSecrets.java:80)
at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow$Builder.(GoogleAuthorizationCodeFlow.java:211)
at GmailQuickstart.getCredentials(GmailQuickstart.java:55)
at GmailQuickstart.main(GmailQuickstart.java:69)
Specifications
Java version (java -version)
$ java -version
java version "18.0.1.1" 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)
well, I found the response, first i use the json build from ID clients OAuth 2.0 and not the json build from service Account, and then in ID clients OAuth 2.0 i add the URL in backend section : http://localhost:8888/Callback, and it's ok
I am experiencing this issue as well in a maven project. I am not quite understanding @ptro46 comment. However, it seems to be a configuration issue from the Google console rather than the code. Can instructions be clearer and more beginner friendly please?
Hi @erikacamilleri in fact I was not using the correct json, when following their doc there are two different json generated and I was not using the correct one, taking the other it worked
Hi @ptro46
can you explain the steps that you did to fix your issue?
I follow all the steps and create the json from service-account key. But I have the follow error
Exception in thread "main" java.lang.IllegalArgumentException
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:121)
at com.google.api.client.util.Preconditions.checkArgument(Preconditions.java:35)
at com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets.getDetails(GoogleClientSecrets.java:80)
at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow$Builder.<init>(GoogleAuthorizationCodeFlow.java:211)
at tech.sharelock.google.drive.AdminSDKReportsQuickstart.getCredentials(AdminSDKReportsQuickstart.java:65)
at tech.sharelock.google.drive.AdminSDKReportsQuickstart.main(AdminSDKReportsQuickstart.java:74)
it is the same stack trace
This is my configuration
The downloaded json is what i use as credential.json
Where am I doing wrong?
Activity
ptro46 commentedon May 20, 2022
well, I found the response, first i use the json build from ID clients OAuth 2.0 and not the json build from service Account, and then in ID clients OAuth 2.0 i add the URL in backend section : http://localhost:8888/Callback, and it's ok
erikacamilleri commentedon Jul 8, 2022
I am experiencing this issue as well in a maven project. I am not quite understanding @ptro46 comment. However, it seems to be a configuration issue from the Google console rather than the code. Can instructions be clearer and more beginner friendly please?
ptro46 commentedon Jul 8, 2022
Hi @erikacamilleri in fact I was not using the correct json, when following their doc there are two different json generated and I was not using the correct one, taking the other it worked
gianluca-valentini commentedon Sep 27, 2022
Hi @ptro46
can you explain the steps that you did to fix your issue?
I follow all the steps and create the json from service-account key. But I have the follow error
it is the same stack trace
This is my configuration
The downloaded json is what i use as credential.json
Where am I doing wrong?