To create your own Google Drive client ID and secret, you need to go to the Google Cloud Console.
Here's the general web address and the steps involved:
The main web address is:
https://console.cloud.google.com/
Steps to create a Google Drive Client ID and Secret:
Sign in to Google Cloud Console: Go to https://console.cloud.google.com/
and sign in with your Google account.
Create a Project (or select an existing one):
If you don't have a project, you'll be prompted to create a new one. Give it a descriptive name (e.g., "My Drive Client App").
If you have existing projects, select the one you want to use for your Google Drive integration.
Enable the Google Drive API:
In the Google Cloud Console, navigate to "APIs & Services" > "Library" (or use the search bar).1
Search for "Google Drive API" and select it.2
Click the "Enable" button.
Configure the OAuth Consent Screen:
Still under "APIs & Services," go to "OAuth consent screen."3
Choose the "User type" (usually "External" for personal projects or apps used by external users).4
Click "Create."
Fill in the required information:
App name: The name of your application that users will see when they grant consent.5
User support email: An email address for users to contact.
(Optional but recommended for production apps) Application logo, application homepage link, privacy policy link, terms of service link.6
Click "Save and Continue."
On the "Scopes" page, you'll need to add the necessary scopes for Google Drive.7 For basic read/write access to Google Drive, you'll typically add:
.../auth/drive
(Full, permissive scope for Google Drive)8
Or a more specific scope like .../auth/drive.file
(access to files created or opened by the app)
Click "Add or Remove Scopes," select the appropriate Drive scopes, and click "Update." Then "Save and Continue."9
On the "Test users" page, add any Google accounts you'll use for testing before publishing the app.10
Click "Save and Continue."
Review the summary and go "Back to Dashboard."
Important for production apps: You'll likely need to set your "Publishing status" to "Production" after testing to avoid consent screen limitations.
Create Credentials (OAuth Client ID):
Still under "APIs & Services," go to "Credentials."11
Click "+ CREATE CREDENTIALS" at the top, and select "OAuth client ID."
Application type: This is crucial. Choose the type that best describes your client:
Web application: For web-based apps (JavaScript origins and Redirect URIs).12
Desktop app: For applications running on a desktop computer.
Android / iOS: For mobile applications (requires package name/bundle ID and signing certificate fingerprint).
TVs and Limited Input devices: For devices like smart TVs.13
Name: Give your OAuth client ID a name.
Authorized JavaScript origins (for Web applications): If you're building a web app, add the URLs where your app will be hosted (e.g., http://localhost:8080
for local development, https://yourdomain.com
).
Authorized redirect URIs (for Web applications, Desktop apps, etc.): This is the URL where Google will send the user back after they've granted consent.14 For desktop apps, it's often a loopback address like http://localhost
.
Click "CREATE."
Copy your Client ID and Client Secret:
A dialog box will appear displaying your Client ID and Client Secret.
Copy these immediately and store them securely! The Client Secret is often shown only once. You can also download them as a JSON file.
These Client ID and Client Secret are what your application will use to identify itself to Google's OAuth 2.0 servers when requesting access to a user's Google Drive.