Configure OAuth for your application

To configure OAuth for your application, you set up an OAuth workflow, and you enable the Data Portability API OAuth scopes.

Set up an OAuth workflow

To set up an OAuth flow for your application, follow the basic steps in the Google Identity documentation.

Most developers use the Server-side Web Apps flow for obtaining OAuth consent, but you can also use the JavaScript Web Apps flow or the Mobile and Desktop Apps flow.

Data Portability API OAuth scopes

When you configure your Data Portability API application for OAuth, enable the Data Portability API OAuth scopes that are relevant to your application. For a list of all OAuth scopes supported by the Data Portability API, see the OAuth 2.0 Scopes for Google APIs. For a list of all resource groups and OAuth scopes supported by a particular service, see the schema reference page for that service.

When you add the Data Portability API scopes to your OAuth flow, there may be cases where your user gives consent to some but not all of the scopes. Your app must be able to handle these cases by:

  • Allowing partial data exports
  • Notifying the user that they didn't select all the necessary scopes (and failing gracefully)
  • Asking the user for the remaining consents

You should note that a user's consent allows you one data export for that specific consent. To download the data again, you need a new consent from the user.

You should also note that during the OAuth flow, your app does not know which Google Account was used to give consent. The OAuth token your application receives is opaque.

If you are looking for information on how users share data, see Share a copy of your data with a third party.