Skip to main content
Google Docs (EXT:ns_googledocs) needs a Google Client ID, Client Secret and Refresh Token to read the Docs in your Google account. Create them once, then enter them in the Global Settings of the extension.
  1. Open the Google Cloud console: https://console.developers.google.com
  2. Create a new project or select an existing one. Google Cloud console: project selector at the top of APIs & Services
  3. Open Credentials, click Create credentials and choose OAuth client ID. Google Cloud console: Credentials, Create credentials, OAuth client ID
  4. Select the application type Web application and add https://developers.google.com/oauthplayground under Authorized redirect URIs. Create OAuth client ID: Application type Web application and Authorized redirect URIs
  5. Google creates your Client ID and Client Secret. Client ID for Web application: Client ID and Client secret with the OAuth Playground redirect URI
  6. Open Library, search for Google Drive API, select it and click Enable. API Library: search for Google Drive API and select it
  7. Open the OAuth 2.0 Playground: https://developers.google.com/oauthplayground/
  8. Open the settings (gear icon), tick Use your own OAuth credentials and enter your Client ID and Client Secret. OAuth 2.0 Playground settings: Use your own OAuth credentials with Client ID and Client secret
  9. In Step 1, enter this scope in Input your own scopes (or tick only this scope under Drive API v3) and click Authorize APIs:
    The extension makes only two Google Drive calls: it lists the Google Docs files in your Drive and exports a Doc as HTML. Read-only access is enough, so do not select the other Drive scopes. OAuth 2.0 Playground Step 1: Drive API v3 scope list and Authorize APIs button Sign in with the Google account that owns or can read the Docs, and click Allow.
  10. In Step 2, click Exchange authorization code for tokens. Copy the Refresh token (it starts with 1//). Do not copy the Access token. OAuth 2.0 Playground Step 2: Refresh token after Exchange authorization code for tokens
Enter the Client ID, Client Secret and Refresh Token in the Global Settings of EXT:ns_googledocs.

Refresh token validity

Access token and refresh token

The OAuth Playground shows two tokens: The countdown in the Playground is for the access token only. When it reaches zero, the extension keeps working. You do not need to generate a new token.

When the refresh token stops working

Google stops accepting the refresh token in these cases: To avoid the 7-day limit, set the publishing status to In production in the Google Cloud console (Google Auth Platform › Audience, in older consoles OAuth consent screen). The 24-hour limit mentioned in the OAuth Playground does not apply, because you use your own OAuth credentials (step 8).

Generate a new refresh token

When the refresh token has stopped working, the Google Docs module lists no Docs or shows an error.
  1. Repeat steps 7 to 10 above to get a new refresh token.
  2. Replace the old value in Google Refresh Token in the Global Settings and save.
Your Client ID and Client Secret stay the same.