ownCloud uses OAuth 2.0 to connect to Google Drive. This requires configuration through Google to get an app ID and app secret, as ownCloud registers itself as an app.
All applications that access a Google API must be registered through the Google Cloud Console. Follow along carefully because the Google interface is a bit of a maze and it’s easy to get lost.
If you already have a Google account, such as Groups, Drive, or Mail, you can use your existing login to log into the Google Cloud Console. After logging in click the Create Project button.
Give your project a name, and either accept the default Project ID or create your own, then click the Create button. For this example a random name was chosen, "owncloud-04-27". However, feel free to choose your own name.
After your project is created, click on the notifications bell and select your project.
Go to Api overview to select google’s API.
Now you must create your credentials.
First, select "Web Browser" and "User data".
The next screen that opens is Create OAuth 2.0 Client ID. Enter your app name.
https://example.com, without a trailing slash. Examples:
https://example.com http://example.com IP/owncloud
You need to configure Authorized Redirect URIs, and they must be in this form:
If you are configuring storage as an Administrator - choose the admin URI, if you are a user and configuring a storage - pick the personal URI.
If you are not sure what your exact URIs are - here is a quick guide to figure it out.
This is just the address you access your ownCloud server at, where you see the login screen.
Authorized Redirect URIs
If you have not already enabled the Google Drive storage, here is how you do it:
Here is the correct result:
Now we have to create a consent screen. This is the information in the screen Google shows you when you connect your new Google app to ownCloud the first time.
Now you can download the credentials as a JSON file.
You can see either open this file with the editor of your choice (SublimeText for example), or you can put in in your web browser. This is when you do the later:
Enter the Client ID and Client Secret in the app and press Grant Access.
Now you have everything you need to mount your Google Drive in ownCloud.
Your consent page appears when ownCloud makes a successful connection.
When you see the green light confirming a successful connection you’re finished.
See the Configuring External Storage (GUI) for additional mount options and information.