Using your own Google App is optional. For an easy setup you can just use the default App of the plugin itself. The advantage of using your own app is limited, but you can for example see some usage statistics and if you are using SSL it is also safer to use your own Google App.
NOTICE: Google will automatically revoke authorizations after 7 days for Apps that are in the 'Testing' status (see Google FAQs). After that period, you will have to re-authorize the plugin itself. So if you want to use your own app, you will have to submit the app for verification via your Google Cloud Console in order to get the status 'In production' and to be able to actually use it with the Use-your-Drive plugin. Or you can revert to the default app of Use-your-Drive which is published by Google .
NOTICE: If you encounter any issues when trying to use your own App with Use-your-Drive, please fall back on the default App by emptying the Client ID & Secret on the Plugins settings page.
To create your own Google App complete these steps:
- Go to the Google Developers Console
- Create a new project
- In the sidebar on the left (via ☰), select APIs & Services,
- In the APIs & Services, click on Library and find the Drive API. Click on the API and press enable API
- Select OAuth consent screen on top
- Select the 'External' user type if you don't use Google G Suite, otherwise you can select 'Internal'.
- Insert at least a Product Name and select an email address (don't forget it, or you will get an 'Invalid Client' error). Also add The following scopes for the Google APIs:
profile, email, Google Drive API (../auth/drive),
- Enter your domain name in 'Authorized domains'
- Save the page
- In the sidebar on the left, select Credentials
- Go back to the tab Credentials
- Click on Create credentials -> OAuth client ID. Select Web application
- Enter a name (can be everything, and doesn't really matter) and add to Authorized redirect URI the URl that you will find on options page of Use-your-Drive on the Advanced tab -> Own Google App. (E.g. https://www.yourdomain.com/wp-content/plugins/use-your-drive/includes/_authorizeApp.php)
- Insert the Client id and Client secret on the Plugin settings page, save the settings and Authorize the Plugin