Google Drive
Google Drive
Supports team drives (fill in the directory ID of the team drive for the root directory ID)
1. Necessary Conditions
Notes
- The machine where the OpenList service is deployed must first be able to connect to Google Drive.
- The Google Drive API service must be activated. For the activation method, see Enabling the Google Drive API.
Refer to Google Workspace > Google Drive > Guide: https://developers.google.com/workspace/drive/api/quickstart/js
2. Preparation for Integration
2.1. Enabling the Google Drive API
- On the guide page, find the
Enable APIbutton, click to enter the quick activation interface, click Next and Confirm to complete the activation. - You can also visit the Google Drive API management interface, find the
Enablebutton at the top, click and wait for the activation to complete. Quota and System Limit Management(optional): Switch to theQuota and System Limitstab, and set appropriate quotas and limits according to your usage and needs.
2.2. Creating an OAuth Client (optional; no need to create if using OpenList/Community server/self-hosted server)
- In the Credentials interface, click the
Create Credentialsdrop-down menu, and select and clickOAuth Client ID.

- In the pop-up window, select
Web Applicationand fill in the application name. - In the
Authorized Redirect URIs, enterhttps://api.oplist.org/googleui/callback. If using a self-hosted or Community server, enter the corresponding domain name, such ashttps://your-domain.com/googleui/callback. - Click the
Createbutton to complete the creation of the OAuth client. Note: Please copy and save theClient IDandClient Secretfor subsequent use.

- Add yourself as a test user. Find the
Targetmenu on the left, click to enter, find the+ Add Userbutton underTest Users, click and enter your Google account email address, then click Add.

- After testing, you can publish the application. Find the
Targetmenu on the left, click to enter, find thePublish Appbutton underPublishing Status, click and confirm to complete the app publishing.

2.3. Obtaining Access Token and Refresh Token
- Open the OpenList Google Authorization Page ⚠️ If using a Community server/self-hosted server, visit the Community server/self-hosted server.
- In the drop-down box on the page, select
GoogleDrive Login.


- If you created an OAuth client ID in the above steps, enter the created
Client IDandClient Secretin the following input boxes.


Otherwise, check ☑️ to use the API provided by OpenList. ⚠️ If using a Community server/self-hosted server, the built-in client ID and application secret of the Community server/self-hosted server are used at this time.


- Click the
Get Authorizationbutton, the system will jump to the Google authorization page, log in to your Google account, and authorize OpenList to access your Google Drive.

- If the prompt
This app isn't verified by Googleappears, clickAdvanced, then clickGo to oplist.org (unsafe)to continue. (If it is a Community server/self-hosted server, the domain name here is based on the actual Community service domain name, please carefully identify).

- Please pay attention to the permission information on the authorization page (in the red box below), ensure that it only accesses your Google Drive files. If you find that the permission in the Community service is not limited to accessing Google Drive, please raise an issue in openlistteam/docs/issues.

- After successful authorization, the system will return a
Refresh TokenandAccess Token. Please copy and save the token for use in subsequent configurations.


3. Adding Google Drive to Alist
3.1. Configuration Instructions
3.1.1. Root Folder ID
Similar to Alibaba Cloud Drive, it is the last string in the official website URL, such as:

3.2. Starting to Add
- Open the Alist management interface and click the
Storagemenu on the left. - On the storage list page, click the
Add Storagebutton in the upper right corner. - Select the driver as
Google Drive.


- Enter the mount path, such as:
google-drive. - Enter the root folder ID obtained above in the
Root Folder ID. If using the root directory, enterroot. - Enter the refresh token obtained above in the refresh token (if not obtained, please refer to Preparation for Integration ).
- If you are using the OAuth client ID and secret provided by
OpenList (or Community server/self-hosted server), configure according to7.1and7.2:
7.1. CheckUse online apito indicate using the online API provided by OpenList.
7.2. Fill in the Api url address ashttps://api.oplist.org/googleui/renewapi. If it is aCommunity server/self-hosted server, enter the corresponding server address.


- If you are using your own created OAuth client ID and secret, configure according to
8.1and8.2:
8.1. Do not checkUse online apito indicate using your own built OAuth client ID and secret.
8.2. Enter yourOauth Client IDinClient IDand yourOauth Client SecretinClient Secret.


- Click the
Addbutton to complete the addition of Google Drive.