Skip to content
This repository was archived by the owner on Apr 22, 2026. It is now read-only.
This repository was archived by the owner on Apr 22, 2026. It is now read-only.

Problem with client secret #10

Description

@l-g
% 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions