Skip to content
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

Problem with client secret #10

Open
l-g opened this issue Dec 16, 2019 · 0 comments
Open

Problem with client secret #10

l-g opened this issue Dec 16, 2019 · 0 comments

Comments

@l-g
Copy link

l-g commented Dec 16, 2019

% java -jar ./target/mail-importer-0.0.0-SNAPSHOT-jar-with-dependencies.jar --mailbox /tmp/export/forum.mbox/
Exception in thread "main" com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error in custom provider, java.lang.IllegalArgumentException: 
  while locating to.lean.tools.gmail.importer.gmail.Authorizer
  at to.lean.tools.gmail.importer.gmail.GmailServiceModule.configure(GmailServiceModule.java:43)
  while locating com.google.api.client.auth.oauth2.Credential
    for parameter 1 at to.lean.tools.gmail.importer.gmail.GmailService.<init>(GmailService.java:46)
  at to.lean.tools.gmail.importer.gmail.GmailServiceModule.configure(GmailServiceModule.java:42)
  while locating to.lean.tools.gmail.importer.gmail.GmailService
    for parameter 0 at to.lean.tools.gmail.importer.gmail.Mailbox.<init>(Mailbox.java:73)
  while locating to.lean.tools.gmail.importer.gmail.Mailbox
    for parameter 0 at to.lean.tools.gmail.importer.gmail.GmailSyncer.<init>(GmailSyncer.java:39)
  while locating to.lean.tools.gmail.importer.gmail.GmailSyncer
    for parameter 2 at to.lean.tools.gmail.importer.Importer.<init>(Importer.java:90)
  while locating to.lean.tools.gmail.importer.Importer

1 error
	at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
	at to.lean.tools.gmail.importer.Importer.main(Importer.java:81)
Caused by: java.lang.IllegalArgumentException: 
	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:880)
	at com.google.api.client.json.JsonParser.parse(JsonParser.java:381)
	at com.google.api.client.json.JsonParser.parse(JsonParser.java:335)
	at com.google.api.client.json.JsonParser.parseAndClose(JsonParser.java:165)
	at com.google.api.client.json.JsonParser.parseAndClose(JsonParser.java:147)
	at com.google.api.client.json.JsonFactory.fromReader(JsonFactory.java:236)
	at com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets.load(GoogleClientSecrets.java:192)
	at to.lean.tools.gmail.importer.gmail.Authorizer.loadGoogleClientSecrets(Authorizer.java:131)
	at to.lean.tools.gmail.importer.gmail.Authorizer.get(Authorizer.java:66)
	at to.lean.tools.gmail.importer.gmail.Authorizer.get(Authorizer.java:49)

Caused by: java.lang.IllegalArgumentException: expected numeric type but got class com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets
	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:843)

I have put my client secret in a file called client_secret.json, but the instructions are a bit unclear - should the filename actually be the key?

The result should be a JSON file named something like:

client_secret_729820383-898athoe9t33ntohuoc.apps.googleusercontent.com.json

That is, is client_secret.json the name of the directory rather than the file?

I guess the prefix client_secret should be replaced with some random characters?

My client secret looks like this:

13 digits dash 32 mixed digits and letters followed by .apps.googleusercontent.com

but that one is labelled "client ID" in the Google Console while the "client secret" is a mix of 24 digits and characters with no suffix (like in your example and my client ID).

Can you clarify?

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant