-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gmail API Java Quickstart Exception checkArgument(Preconditions.java:131) #220
Comments
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
it is the same stack trace This is my configuration The downloaded json is what i use as credential.json |
Summary
I follow this quickstart https://developers.google.com/gmail/api/quickstart/java
I create a project and enable the Gmail API
https://developers.google.com/workspace/guides/create-project
I create credentials
https://developers.google.com/workspace/guides/create-credentials
API Key, OAuth client ID, and a Service Account, I download the json file while I create the key in service Account, and I put this file as credentials.json in src/main/resources
Sample Name
Gmail Java Quickstart
Expected Behavior
no exception
Actual Behavior
$ gradle run
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)
OS Mac
The text was updated successfully, but these errors were encountered: