how to unauthorize google docs from a computer

57 views
Skip to first unread message

Divna Krpan

unread,
Oct 3, 2024, 10:09:29 AM10/3/24
to codelab-authors
I have authorized my computer using url for exporting google docs to codelab using claat.

That works fine, but I wanted to use other google account instead, and I can't find how to unauthorize the first one?

I am using mac os, visual studio code built in terminal.


Wu-chang Feng

unread,
Oct 8, 2024, 2:45:36 PM10/8/24
to Divna Krpan, codelab-authors
I believe the credentials claat uses to access your Google Docs is stored in a JSON file....I think if you look for client_secret.json or token.json, you should be able to delete the file and get claat to prompt you to set up new credentials.

--
You received this message because you are subscribed to the Google Groups "codelab-authors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codelab-autho...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/codelab-authors/fe698009-77bd-4d45-8ace-a0033e7e9e21n%40googlegroups.com.

john....@jhanley.com

unread,
Oct 8, 2024, 3:10:55 PM10/8/24
to codelab-authors
The simplest and probably most secure method is to go to https://myaccount.google.com/ and sign out. That will sign you out everywhere on all devices invalidating all tokens.

The credentials file that is mentioned by Wu-chang Feng contains an access token (valid for 60 minutes) and often a refresh token (valid for days, maybe a week). There are endpoints that will invalidate an OAuth token such as  https://oauth2.googleapis.com/revoke

I would use the first method. You are less likely to make a mistake.

Divna Krpan

unread,
Oct 10, 2024, 6:03:45 AM10/10/24
to codelab-authors
Thank you all for your ideas.

First, I was not able to find client_secret.json or token.json on my computer, maybe it is named differently, I'll try to look for something like that.

Second idea, to sign out... Well, I did log out from that computer and also unauthorised CodelabPreview chrome extension (just to be sure). However, now I can't export files on any account - it does not ask me to authorise using URL anymore.
When I try: claat export with doc ID, it doesn't work any more.

401 Unauthorized; {
  "error": {
    "code": 401,
    "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "errors": [
      {
        "message": "Invalid Credentials",
        "domain": "global",
        "reason": "authError",
        "location": "Authorization",
        "locationType": "header"
      }
    ],
    "status": "UNAUTHENTICATED"
  }
}

I have no idea what it saved on my computer and where...

Divna Krpan

unread,
Oct 10, 2024, 6:34:49 AM10/10/24
to codelab-authors
Ok, I think I found some kind of solution.

I have deleted "go" folder and reinstalled go on my mac. Then reinstalled claat using go command:

And it works now!

Nice instructions for installation can be found here: https://mulesoft-labs.dev/codelabs/codelab-setup/index.html
Reply all
Reply to author
Forward
0 new messages