Strategies
Set up consent for a Google web application
For a web app using Gmail, identify the access the feature needs, configure its audience and register the redirect for its application type.

This guide began as a 2024 walkthrough. Google’s console labels have changed since then. For a web application using Gmail, decide what the app will do on behalf of a user before creating credentials.
Choose a project and audience
Use the Google Cloud project owned by the team responsible for the application. Enable the API the feature actually requires. In Google Auth Platform, review Branding, Audience and Data Access. A test application and an application made available to external users can have different verification requirements.
Ask for the smallest suitable permission
Map each requested scope to a real feature. For example, a feature that sends mail should be reviewed against the scopes intended for sending, without requesting broader mailbox access by default. Explain the request in terms a user will recognise.
Configure the web client
Create the OAuth client for the correct application type. Register the exact redirect URI used by the application. A web-server client has a public client ID and a confidential secret. Keep the secret in the application’s secure server-side configuration and out of browser code, public repositories and support forms.
Verify the consent journey
Use a designated test account. Check the application name and requested permissions, approve the request and confirm the intended task works. Then deny or revoke access and check that the application offers a clear recovery path without exposing tokens.



