Exciting News! Flipper Code is now WePlugins! Same commitment to excellence, brand new identity.

How to Generate Google Drive Client ID & Secret Key

Sandeep Kumar Mishra
Sandeep Kumar Mishra
September 7, 2021
5 minutes read
The WP DISPLAY FILES plugin requires the usage of the Google Drive ‘Client ID’ & ‘Client Secret Key’ to display Google Drive files on the frontend. To create a shortcode for Google Drive in the WP Display Files Plugin, you need to generate the ‘Client ID’ & ‘Client Secret Key’.

Generate Google Drive ‘Client ID’ & ‘Client Secret Key’

  1. Step 1: Please sign in with your Google Cloud console.
  2. Step 2: Click the Project dropdown and create a new project.
    Create New Project
  3. Step 3: Search for Google Drive API in the search bar and then enable Google Drive API.
    Enable Google Drive API
  4. Step 4: Click on the Credentials menu on the left sidebar, then click on + Create Credentials. Choose the OAuth Client ID option. Now click on CONFIGURE CONSENT SCREEN button.
    Configure Consent Screen
  5. Step 5: On the OAuth consent screen, specify the user type. Choose the External radio button and click on Create button.
    Specify User Type
  6. Step 6: Insert App Name, user support email, and developer’s email addresses.
    App Name and Emails
    App Details
  7. Step 7: Click on OAuth Consent Screen in the left menu, click on the + Add Users button, and add a user by specifying your email address. This email will have access to the app. Log in to this email account in a different browser tab.
    Add User
  8. Step 8: Click the Credentials menu on the left, then click on + Create Credentials and select OAuth Client ID.
    Create OAuth Client ID
  9. Step 9: Choose Web Application from Application Type. Enter a name for your OAuth 2.0 client and then enter an authorized redirect URI. For the redirect URI, just copy your current backend page URL (Google Drive Authorization backend page URL) and enter it in the URIs field as shown in the image. Click on the Create button.
    Web Application Settings
  10. Step 10: The OAuth Client will be created along with its credentials. A popup will display the Client ID and Client Secret. Copy and paste them into the form displayed on the left side and click on the Save Settings button.
    Copy Client ID and Secret
  11. Step 11: If you are not logged in to the email account specified in Step 7, please log in at this stage. Google will notify you that this app is not verified. Click on the Continue link and on the next screen, enable the checkbox to allow this app to access Google Drive and perform actions. If you are already logged in to the allowed user’s account, you may directly see a popup with an Allow button. Click on this button to grant access.
    Grant Permission
  12. Step 12: Google may again confirm providing access to your App. Click on the Allow button to grant access. With this, the connection will be established. Now you can go to the create shortcode screen and choose Google Drive to display a listing of files and folders.
    Grant Access to App

Explore the latest in WordPress

Trying to stay on top of it all? Get the best tools, resources and inspiration sent to your inbox every Wednesday.