Google Drive

[Note]Note

For use with the Upload to Google Drive post-processing engine.

Creating the custom helper
[Note]Note

This needs to only be done once, on the site which you will be using to host the OAuth2 helpers. It may be the same, or a different site than the one you are going to use the helpers on.

Getting the Callback URL

Log into the backend of the site you want to host the OAuth2 helpers.

Go to Components, Akeeba Backup for Joomla!, Control Panel.

Click on Options.

Click on the OAuth2 Helpers tab.

Set OAuth2 Helper for Google Drive to Yes. You will see a blue note with three URLs below. Copy the Callback URL. It looks something like this (line breaks added for clarity):

https://www.example.com/index.php?option=com_akeebabackup

&view=oauth2&task=step2&format=raw&engine=googledrive

Copy this URL. Please remember that you need to use this URL verbatim in a later step.

Click on the Close button, without saving the component options.

Creating the API application

Log into the Google Cloud Console.

Click the top drop-down (project selection) and click on New Project.

Give it a name and click on Create.

Make sure the application is selected in the drop-down at the top. If not, do it now.

Click on the hamburger menu icon on the top left. Click on APIs & Services, Library.

Look for Google Drive API and click on the item by that name.

Click on Enable.

Click on the hamburger menu icon on the top left. Click on APIs & Services, OAuth Consent Screen.

Choose External. Click on Create.

Fill in all the required fields. In the Authorized domains section click on Add Domain and enter the domain of the site where the custom OAuth2 helper will be hosted.

Click on Save and Continue.

Click on Add or Remove Scopes.

Look for auth/drive and select (check) the scope which appears as .../auth/drive, then click on Update. You should now see it under "Your restricted scopes".

Click on Save and Continue.

Optional. Click on Add Users to add the Google Account email addresses of everyone who will be allowed to use this API application to link their Akeeba Backup installations with Google Drive. Otherwise, only you (the account which created this API app) will be able to log in.

Click on Save and Continue.

Click on the hamburger menu icon on the top left. Click on APIs & Services, Credentials.

Click on Create Credentials, then click on OAuth Client ID.

Select Web application in the drop-down.

Find Authorized redirect URIs and click on Add URI under it.

Paste the Callback URL you copied earlier.

Click on Create.

Copy the Client ID and Client Secret displayed to you.

Enabling the custom OAuth2 Helper

Log into the backend of the site you want to host the OAuth2 helpers.

Go to Components, Akeeba Backup for Joomla!, Control Panel.

Click on Options.

Click on the OAuth2 Helpers tab.

Set OAuth2 Helper for Google Drive to Yes.

Paste the Client ID and Client Secret you copied in the previous step into the same-named text boxes under the "OAuth2 Helper for Google Drive" section.

Click on Save & Close.

Using the custom helper
[Note]Note

This needs to be done on every Akeeba Backup installation and backup profile which will be using this custom OAuth2 helper. The site using the OAuth2 helper does not necessarily have to be the same site you have set up the OAuth2 helper on.

Getting the OAuth2 Helper and Refresh URLs

Log into the backend of the site which hosts the OAuth2 helpers.

Go to Components, Akeeba Backup for Joomla!, Control Panel.

Click on Options.

Click on the OAuth2 Helpers tab.

Find the OAuth2 Helper for Google Drive. You will see a blue note with three URLs below.

Copy the OAuth2 Helper URL and OAuth2 Refresh URL.

Telling Akeeba Backup to use a custom helper

Log into the backend of the site you will be taking the backups on. This may be different than the site which hosts the OAuth2 helpers.

Go to Akeeba Backup, select your backup profile, and click on Configuration.

Scroll down to the Post-processing Engine.

Select Upload to Google Drive

Change the OAuth2 Helper to Custom.

Paste the OAuth2 Helper URL and OAuth2 Refresh URL you copied in the previous step.

Click on Save. This is important! Until you click on Save, Akeeba Backup does not know you intend to use a custom OAuth2 Helper.

Authentication and setup

When the page reloads, click on Authentication - Start here.

[Tip]Tip

You will know you are doing it right if the popup displays a warning letting you know what you are about to link it with an application which is not under the control of Akeeba Ltd. If you see the Google Drive interface, you missed the previous step (clicking on Save); in this case close the popup, click on Save, and then click on Authentication - Start here again.

Go through the authentication.

At the end, you will see an Access Token and a Refresh Token. Copy them into the respective fields of your Akeeba Backup profile.