Google OAuth2 which end-point URLs and scope values can I use?
When using Gmail or Google Cloud Platform services, you use the Google OAuth2 framework.
To set up your application for use with Google OAuth2, you need to know the following:
- Which endpoint URLs to configure
- Which scope values to use
Endpoint URLs
Use the following URLs to configure your OAuth2 connection to Google:
| URL | Description |
| https://accounts.google.com/o/oauth2/v2/auth | Authorization code URL. Used only in the authorization code flow. |
| https://oauth2.googleapis.com/device/code | Device code URL. Used only in the device code flow for desktop applications. |
| https://oauth2.googleapis.com/token | Token endpoint. Used in all OAuth2 flows. |
Whether you use authorization code flow or device code flow depends on the “Application type” selected when creating the application.
Scope values
When building an OAuth2 application, you must specify which scopes you need to access. If you are configuring OAuth2 for Google services in an existing desktop application, this usually does not apply.
| Scope | Description |
| Used to send email when using the device code flow. | |
| https://mail.google.com | Used to send and receive email when using the authorization code flow. |