Create a project

Turn on the APIs your tools call

Set up the consent screen

- App information: your product’s name, which is what users see on the consent screen, and a support email they can reach.
- Audience: External. Internal only lets in accounts from your own Google Workspace organization, so it can’t serve customers.
- Contact information: where Google writes to you about the app.

Create a web application client

http://localhost:8765/callback as a second redirect URI, and remove it once
you go to production.Copy the client ID and secret


Declare the scopes
scopes_for
reads them off whichever tools you actually hand out:Publish, then get verified

- Only sensitive scopes (Calendar, Sheets, Docs, Forms, and sending
mail with
gmail.send): Google verifies the app. It checks your branding and domains, reads a justification for each scope, and watches a short video of your app using them. - Any restricted scope (reading, drafting or relabelling mail; reading or changing Drive files your app did not create): the same review, plus an independent security assessment of how your servers store and handle Google data. It’s repeated every year, and you arrange and pay for it.
Connect a user
flow.authorize() builds. The user
picks an account and approves the scopes.grant.scopes against what you asked for before you store the refresh token.
Google doesn’t rotate refresh tokens, so the one you store stays the one you
use. Google’s provider page
covers the rest: the hundred-token cap per account, and what fails silently.When it does not work
redirect_uri_mismatch
redirect_uri_mismatch
“Access blocked: … has not completed the Google verification process”
“Access blocked: … has not completed the Google verification process”
invalid_grant, about a week after a user connected
invalid_grant, about a week after a user connected
403: “Request had insufficient authentication scopes”
403: “Request had insufficient authentication scopes”
403: “… API has not been used in project N before or it is disabled”
403: “… API has not been used in project N before or it is disabled”
Related
- Google — the server constant, every scope, the hundred-token cap and what else fails silently
- Getting the grant — the two routes,
stateand PKCE, inside your app - Every pack — what each pack’s users connect with, and what you store
- Set up Google — your own account, with a Desktop client and a script