jessfraz / gmailfilters

A tool to sync Gmail filters from a config file to your account.
MIT License
548 stars 34 forks source link

Improve credentials creation documentation #7

Open inkel opened 5 years ago

inkel commented 5 years ago

Hi! As we discussed on Twitter, I've been trying to use this tool but no matter what combination of things I click on the console for creating the credentials, I always end up with the following message:

parsing client secret file to config failed: oauth2/google: no credentials found

After enabling the Gmail API from the console, I click on Create Credentials and I'm being present with a form. First question is from where am I going to use the API:

image

Next question is whether I want to give access to User data or Application data, so I've chosen the latter:

image

Then I proceed to click on What credentials do I need? and I'm presented with the following:

image

Here is where it gets tricky, as none of the roles seem to match the Gmail labels notion that I was expecting. I've chosen different things but when the JSON file is downloaded and I pass it to gmailfilters it always fails when parsing the file.

Thank you very much for your time and for all the great tools you've written so far!

alex-hofmann commented 5 years ago

Hey @inkel I was confused to, but managed to figure it out by performing the following

  1. Go to the Google API console Google Cloud Platform
  2. New Project Google Cloud Platform "Create"
  3. Make sure your new / current project is selected and go to API Library Gmail API Google Cloud Platform "Enable"
  4. Now to create credentials Google Cloud Platform , "Create credentials" , "Help me choose" , What API are you using? Gmail API Where will you be calling the API from? Other UI What data will you be accessing? User data "What credentials do I need?" Fill out relevant info to create OAuth client ID
  5. Download credentials and save it as credentials.json

Using the downloaded credentials.json should work with this gmailfilters project

gservat commented 5 years ago

I've been doing a little reading on this and I can't work it out. Is there a way to set the access permissions up using cross-account? i.e. I have my own personal Google account where I want to create the project with Gmail API access, but the gmail filters I want to push are for my work account in another org.

inkel commented 5 years ago

@alex-hofmann thank you so much! Sorry for the late response. Your instructions worked 💪

JustACuteGirlLookingForAManToFixHerBugs commented 4 years ago

Can you help me as well? I'm really confused by all this, still a newbie.

I've tried to do it myself, created some OpenAuth file, it sort of authorized I guess, and then I was just stuck with an error "credentials can't be empty" or something like that.

I've deleted everything (the folder, I dunno how to uninstall properly with go). Then done everything to your instruction here, and now when I send C:\Users\satyr\go\src\github.com\jessfraz\gmailfilters>gmailfilters -f "C:\Users\satyr\go\src\github.com\jessfraz\gmailfilters\credentials.json" it spits out: must pass a path to a gmail filter configuration file