node.jsgoogle-apigoogle-oauthgoogle-api-clientgoogle-api-nodejs-client

How do you locate and delete the auth information that google saves to your disk file to connect to the api with a different email? NODE.JS on MAC OS


I ran a test run to learn how to connect to google calendar api via node.google auth with node js

I re-walked through the steps to attempt to connect my actual project to google calendar api, but when i run node quickstart.js i get this error:

The API returned an error: Error: unauthorized_client

after hours of deliberating I figured out that the Google client library was saving my auth info on my disk. So, when i ran node quickstart.js, I received an error because my new client_secret.json that I created for my actual project, did not match the info in my client_secret.json that was created in my test run.

A doc suggestion that I found that i think is relevant:

// If modifying these scopes, delete your previously saved credentials
// at ~/.credentials/calendar-nodejs-quickstart.json

but when I navigate to my user folder I do not have a .credentials directory, thus I'm unable to locate and delete my old auth info.

I tried searching for oauth via global search and found a few oauth.js files that I thought were the issue. I naively deleted all of them and then re ran the command only to find the terminal yell at me for not having an oauth node module.

After more hours of replacing the oauth files I deleted I'm still unable to locate or delete the troublesome auth info.

Has anyone encountered a similar problem while programming on a mac and connecting to Google API thru node?


Solution

  • The problem I had was finding that credentials directory. I learned that it was a hidden folder and learned how to show/hide hidden folders.

    For any future problem havers, just need to follow these steps:

    1. Navigate to /Users/YOURUSERPROFILE in the finder
    2. Press CMD + SHIFT + . to show the hidden credential folder