WP Display Files plugin requires the usage of the Google Drive ‘Client ID’ & ‘Client Secret Key’ to display Google Drive files on the frontend, in order to work properly. To create a shortcode of the Google Drive in WP Display File Plugin You need to create the ‘Client ID’ & ‘Client Secret Key’.
Generate Google Drive ‘Client ID’ & ‘Client Secret Key’
Follow these steps to get a Google Drive ‘Client ID’ & ‘Client Secret Key’:
Step 1: Please sign in with your Google Cloud console.
Step 2: Click Select a Project dropdown and Create a New project.
Step 3: Search Google Drive API in the search bar and then enable Google Drive API
Step 4: Click on the Credentials menu on the left sidebar, & then click on + Create Credentials as shown below the image. Choose the OAuth Client ID option. Now click on CONFIGURE CONSENT SCREEN button.
Step 5: On the OAuth consent screen, you need to specify the user type. Choose the External radio button and click on Create button.
Step 6: Insert App Name, user support email, and developer’s email addresses.
Step 7: Again, click on Oauth Consent Screen in the left menu, click on the + Add Users button and add a user by specifying your email address into it. Using this email address you will have access to this App. Now in a different browser tab, please log in to this email account.
Step 8: Click the Credentials menu on the left, then click on + Create Credentials and then select OAuth Client ID.
Step 9: At this step choose Web Application from Application Type. Enter a name for your OAuth 2.0 client & then enter an authorized redirect URI. For redirect URI – just copy your current backend page URL (Google Drive Authorization backend page URL ) and enter it in the URIs field as displayed in the below image. Click on create button at the bottom.
Step 10: At this step, Oauth Client will be created as well as its credentials. A popup will be displayed with client Id and Client Secret. Copy and paste them in the form displaying on the left side and click on the Save Settings button.
Step 11: At this step, if you are not logged in to the email account you specified in Step 7, please login at this step. 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 the Gdrive and to perform actions. If you are already logged into the allowed user’s account you may directly see a popup with an Allow button. Click on this button to grant access.
Step 12: At this step, google may again confirm to provide access to your App. Click on Allow button to grant access. With this, the connection will be established. Now you can go to create a shortcode screen and choose Google Drive to display a listing of files and folders.
Google Drive setup is now complete. Now you just need to create a shortcode to display files and folders listing from Google Drive.
Now follow this tutorial to quickly display listing using these keys.
Subscribe to our newsletter below and never miss the latest updates or an exclusive offer.