## Google Drive integration Integrating Google Drive with Frontegg allows your application to list, create, update, and delete files and folders, manage file permissions, read comments and revisions, and retrieve Drive metadata — all through Frontegg's integration layer using Google OAuth 2.0. Prerequisites - A Google account with access to [Google Cloud Console](https://console.cloud.google.com/) - A Google Cloud project (you can create one during setup) ### Enable the Google Drive API #### Step 1: Open the Google Drive API in the API library Go to the [Google Drive API](https://console.cloud.google.com/apis/library/drive.googleapis.com) page in the Google Cloud Console. Select your project from the top navigation, then click **Enable** if the API is not yet enabled. If you see **Manage** and **API Enabled**, the API is already active. ![Google Drive API page in Google Cloud Console](/assets/google-drive-1.678dd134146a44d11f93ecdf436c583a3f31867a555de8e1d56913e82c64b701.1ce25488.png) ### Create an OAuth client #### Step 2: Go to the Credentials page In the left sidebar, navigate to **APIs & Services** → **Credentials**. Click **Create credentials**. ![Credentials page with Create credentials button highlighted](/assets/google-drive-2.578cc2da3d861a153fb6202a3a4bb2febef7e0e7c23f4ddf681f5e03f04f8e93.1ce25488.png) #### Step 3: Select OAuth client ID From the dropdown, select **OAuth client ID**. ![Create credentials dropdown with OAuth client ID highlighted](/assets/google-drive-3.6fc165c5a0fbe7e8783e3a2ff03ae93443f00c4d3b0d5a4fe2efa23badaa1ac2.1ce25488.png) #### Step 4: Configure the OAuth client On the **Create OAuth client ID** page: 1. Set **Application type** to **Web application**. 2. Enter a name for the client (for example, `Frontegg Google Drive Integration`). 3. Under **Authorized redirect URIs**, click **Add URI** and add both of the following: - `https://YOUR_MCP_GATEWAY_URL/integration-callback` ![OAuth client form with name and redirect URIs filled in](/assets/google-drive-4.b21ee8859e3db5a08404827d0f25055a47f74514db731a085acbd747770de8cd.1ce25488.png) #### Step 5: Create the client Click **Create** to save the OAuth client. A dialog will display your **Client ID** and **Client Secret** — copy both values and store them securely. Save your Client Secret now The Client Secret is only shown once in this dialog. After you close it, you cannot retrieve it again — you can only create a new secret. ![OAuth client created dialog showing Client ID and blurred Client Secret](/assets/google-drive-5.14eb45d335caecd347f2d7739ddf57983d154b982b128ba24ec98db3ae286b0a.1ce25488.png) ### Copy your credentials #### Step 6: Copy the Client ID from the credentials list After closing the dialog, your new client appears at the top of the **OAuth 2.0 Client IDs** list on the Credentials page. ![Credentials page showing the new Frontegg Google Drive Integration client](/assets/google-drive-6.fe76911dd3bd2a8b7867140157c7aef83af56c9f0db78e6e2a64a372d85fd46e.1ce25488.png) #### Step 7: View Client ID in the client detail page Click the client name to open its detail page. You can view and copy the **Client ID** at any time from the **Additional information** section. ![OAuth client detail page showing Client ID](/assets/google-drive-7.4c9be93e7a645460da8d0f9f0c6f81e07cf9b917400e1378270efb17c7103f75.1ce25488.png) ### Configure the Frontegg portal Once you have your **Client ID** and **Client Secret**, enter them in the Frontegg portal: 1. Open the **Frontegg portal** and navigate to [ENVIRONMENT] → Integrations → Google Drive. 2. Enter the **Client ID** and **Client Secret** in the corresponding fields. 3. Select the required **scopes**: | Scope | Description | | --- | --- | | `https://www.googleapis.com/auth/drive.readonly` | Read-only access to files and Drive metadata | | `https://www.googleapis.com/auth/drive` | Full access to all files and Drive data | | `https://www.googleapis.com/auth/drive.file` | Access to files created or opened by this app | | `https://www.googleapis.com/auth/drive.appdata` | Access to the app's dedicated hidden folder | | `https://www.googleapis.com/auth/drive.metadata` | Read and write file metadata without file content | | `https://www.googleapis.com/auth/drive.metadata.readonly` | Read-only access to file metadata | | `https://www.googleapis.com/auth/drive.photos.readonly` | Read-only access to photos | | `https://www.googleapis.com/auth/drive.scripts` | Access to Google Apps Script files | 1. Click **Save**. Keep your credentials secure Never share or commit your Client Secret to version control. ### Additional resources - [Google Drive API documentation](https://developers.google.com/drive/api/v3/reference) - [Google Cloud Console](https://console.cloud.google.com/) - [Setting up OAuth 2.0](https://developers.google.com/identity/protocols/oauth2/) - [How to get your Redirect URL](/agen-for-work/connectors/redirect-url)