Google Drive
This section has Google Drive-specific authentication and authorization information.
Identify whether to use a restricted scope
When your app is installed, a user is asked to validate the scopes used by the
app. Generally, you do not want users to have to decide to validate use of
restricted scopes. So, when possible, use "recommended" scopes as they narrow
access to specific functionality needed by an app. In most cases, providing
narrow access means using the https://www.googleapis.com/auth/drive.file
per-file access scope.
There are only two types of Drive apps where use of restricted scopes might be permitted:
Use of restricted scopes might be permitted for native and web apps that provide local sync or automatic backup of users’ Drive files.
Use of restricted scopes might be permitted for productivity and educational applications whose user interface might involve interaction with Google Drive. For example, if your app is a chat app that allows a user to paste Drive URL in a discussion, restricted scopes might be permitted. Productivity applications include task management, note taking, workgroup communications, and classroom collaboration applications.
If you believe your app requires a restricted scope, refer to Request restricted scope verification and security assessment.
If you believe your app requires a sensitive scope, refer to How do I submit for verification?.
Request restricted scope verification and security assessment
For apps using restricted scopes, a restricted scope verification must be performed to comply with the Google API Services: User Data Policy and Additional Requirements for Specific API Scopes.
If you store restricted scope data on servers (or transmit), then you need to go through a security assessment. To ensure confidentiality of your application, Google uses third-party vendors to conduct the security assessment.
To request a restricted scope verification, see How do I submit for verification?.
Upon passing the restricted scope verification, you are sent an email with third-party security assessors who you can use to perform your security assessment.
For frequently asked questions about restricted scope verification and the security assessment, refer to OAuth API Application Verification FAQ.
Migrate an existing app to a recommended scope
If you've developed a Drive app that uses any of the restricted scopes, we
recommend migrating your app to use drive.file
scope. This scope enables
users to select the specific files from Google Drive, and through the Google
Picker, that they want to allow your app to access. Apps that use the
drive.file
scope are not required to go through the restricted scope
verification and third-party security assessment.
Many apps work with per-file access without any changes. If you are currently
using your own file picker, we recommend switching to the
Google file picker which fully supports the
drive.file
scope.
Save refresh tokens in long-term storage
You must save refresh tokens in secure long-term storage and continue to use them as long as they remain valid.