OAuth2 Consent Screen (Google API)

Short definition

The OAuth2 consent screen is the browser prompt shown to a user when an application requests permission to access their Google account data, listing exactly which permissions are being requested and requiring explicit approval before any access is granted.

Extended definition

When an application uses OAuth2 to access Google APIs on behalf of a user, Google displays an intermediate consent screen before issuing any access tokens. This screen identifies the application by name, shows the Google account being authorised, and lists each permission scope being requested in plain language. The user can approve or deny. If approved, Google issues an access token and a refresh token that the application uses for subsequent API calls. The consent screen is configured in the Google Cloud Console and must be set up before OAuth2 credentials can be used. For applications in development or internal use, the screen can be left in testing mode with a list of approved test users. For public applications, Google requires a verification process before the screen is shown to arbitrary users.

Deep technical explanation

Consent screen configuration: The consent screen is configured under APIs and Services in the Google Cloud Console. It requires an application name, a support email, and a developer contact address. For internal Google Workspace applications, the user type can be set to Internal, restricting the flow to accounts within the organisation.

Scopes and their display: Each OAuth2 scope requested by the application is listed on the consent screen in human-readable form. Sensitive scopes (those with access to personal data) require additional justification and may trigger Google’s manual verification process. Scopes should be requested at the minimum level needed for the application to function.

Testing mode and test users: An unverified application in External mode can only be authorised by accounts explicitly listed as test users in the consent screen configuration. Attempts by other accounts to authorise the application are blocked. This is the appropriate state for internal tools and pipelines that will never be distributed publicly.

Token storage: Once a user approves the consent screen, Google issues an access token (short-lived) and a refresh token (long-lived). The refresh token is stored locally (typically as token.json) and used by the application to obtain new access tokens automatically without requiring the user to go through the consent screen again.

Refresh token invalidation: Google invalidates refresh tokens if the consent screen configuration changes, if the user revokes access manually, or if the application has been in testing mode for longer than seven days without a verified user. When a refresh token is invalidated, the OAuth2 flow must be run again to obtain a new one.

Scope creep risk: Adding new scopes to an application after initial authorisation requires the user to go through the consent screen again to approve the additional permissions. In automated pipeline contexts, this means updating the scope list and re-running the local auth flow to generate a new token.json.

How BlueGrid.io uses it

BlueGrid.io’s marketing agent pipeline uses OAuth2 with a single consent screen authorisation covering Google Analytics 4, Google Ads, Gmail, and Google Drive simultaneously. The resulting token.json is stored on the control server and refreshed automatically by the Google auth library, meaning the consent screen flow is a one-time setup step that does not need to be repeated unless scopes change or the token is revoked.

Why it matters

The OAuth2 consent screen is the gate between your application and a user’s Google data. Misconfiguring it, requesting the wrong scopes, or failing to handle token expiry correctly are the most common reasons Google API integrations fail silently. Understanding how it works is prerequisite knowledge for any pipeline that depends on Google services.

Share this post

Share this link via

Or copy link