Adding GoogleDrive to your ownCloud deployment is a tricky job, so it is complex to complete and undocumented. Simply following ownCloud guide won't make you get the job done, (this is my personal experience) as there are steps missing.
So, here is my guide personalized for the Pennyitsupport cloud built on the ownCloud generic server. You may already have completed some steps as you will go through, yet, I advise to follow the steps and create new projects from scratch. Let's start now:
Sign in to https://console.developers.google.com/#identifier with your google account:
Click on Drive API in the Google Apps APIs section:
Click on Create project:
Choose a name or leave the default, chose to get updated or not and agree on terms and conditions, then click on Create:
Once created, Enable the project:
After enabling the project, you get an information screen instructing for credentials creation:
Click on Go to Credentials:
Set the API type Google Drive API, set the calling device Web browser (JavaScript) and set the data type you are accessing User data. Click on What credentials do I need?
Fill in the Name (or leave the default) Authorized JavaScript Origins: https://www.pennyitsupport.eu (without trailing /), Authorized redirect URIs: https://www.pennyitsupport.eu/index.php/settings/personal (without trailing /). If you are the administrator of the ownCloud site, you should add in the Authorized redirect URIs an additional entry: https://www.pennyitsupport.eu/index.php/settings/admin (without trailing /)
Click Create client ID to create the ID:
Setup the OAuth 2.0 client screen. Leve the Email address set by default and fill in the Product name shown to users: Pennyitsupport or the name of your choice then click Continue:
Credentials are created:
You can download and save the credentials, then click Done. Note that downloaded credentials are a kind of xml format and retrieve credentials in the file may be tricky. You don't need to download them as you can retrieve them online.
Now, you have successfully created the Google Drive Client API.
If you are a regular user, skip this step and go to the Pennyitsupport cloud sign in step.
For domain owners, before allowing ownCloud to connect to GoogleDrive through the created client, administrator must go through the Domain verification. My personal experience shows that I was unable to add GoogleDrive to ownCloud until I went through the Domain verification. So, click on Domain verification:
Click Add domain:
Fill in your domain name and click again Add domain:
You are instructed to go to the ownership verification, so click on Take me there:
Select your domain name provider (Other if not listed) and Google will generate a key for your domain:
Login to your DNS management portal and enter the following record in your DNS setting:
Host Record type Key
@ TXT "the_key_copied_from_google"
Allow some time for propagation, then go to the bottom of the page and click Verify:
Once google verified your domain ownership, you should see the verified domain in the domain list:
Once the domain verified by Google, users of your cloud (including admin) should be able to add GoogleDrive to the cloud.
Keep this session open and in another tab of the browser or in another session, connect to the Pennyitsupport cloud at https://www.pennyitsupport.eu :
Go to Settings -> Personal: (menu may slightly change from one version to another, yet you need to find the external storage configuration item)
Click on Storage:
Click on the Add storage drop down menu and choose GoogleDrive:
Go back to the GoogleDrive Client API tab:
Click on the Web client 1 link (or the name of your project):
Copy the Client ID in the Pennyitsupport cloud personal Configuration field and the Client secrete to the Pennyitsupport cloud personal Client secrete field:
Click Grant access. Once the button clicked, you are redirected to a Google authorization screen:
Click on Allow and you should get the confirmation that access is granted:
You should now see the GoogleDrive folder in the Files:
Congratulation! You have successfully added and federated GoogleDrive in your ownCloud (account or server).