Edocman Google Drive Plugin

The EDocman - Google DriveV3 plugin allows Edocman to upload, store, and retrieve documents using Google Drive API v3.

The connection uses OAuth 2.0. A Joomla administrator authorizes the application to access a Google account without sharing the account password with Joomla.

Storing documents on Google Drive can reduce long-term storage usage on your web server. However, uploads still use temporary server storage, PHP memory, and execution time.

Scope of this guide: The plugin screenshot shows Joomla 5.3.1. Menu names may differ between Joomla versions. This guide applies to the googledrivev3 plugin implementation that uses the googledriveauthenticate callback.

1. Prerequisites and Plugin Setup

Before configuring the connection, check that your website and Google account meet the following requirements.

Prerequisites

  • Edocman and the EDocman - Google DriveV3 plugin are installed.
  • You have permission to manage Joomla plugins.
  • You have a Google account with sufficient Google Drive storage.
  • You can create or configure a Google Cloud project and OAuth client.
  • Your website uses HTTPS and has a stable public URL.
  • Your server can make outbound connections to Google services.
  • PHP can create and write to the tmp/edupload directory inside your Joomla installation.

If you use Google Workspace, your organization's administrator may need to allow the application to access Google Drive.

Recommendation: Use a Google account intended for managing your website's documents. Avoid depending on an employee's personal account that may later become unavailable.

Enable the Plugin

  1. Sign in to Joomla Administrator.
  2. Open System → Manage → Plugins.
    • On some Joomla versions, use Extensions → Plugins.
  3. Search for EDocman - Google DriveV3.
  4. Open the plugin.
  5. Set Status to Enabled.
  6. Click Save.

EDocman - Google DriveV3 plugin configuration in Joomla

The main configuration fields are:

Field Purpose Value
Client ID Identifies the application's OAuth client Provided by Google Cloud
Client secret Authenticates the client when exchanging an authorization code for tokens Provided by Google Cloud
Root Path Names the root folder managed by the plugin on Google Drive For example, edocman
Status Controls whether the plugin is enabled Enabled

Root Path is a folder name on Google Drive. It is not a server path, URL, or Google Drive folder ID.

The folder creation behavior is explained in section 4.


2. Configure Google Cloud and OAuth

Create a Google Cloud project, enable Google Drive API, and configure the application that will connect to your website.

Step 1: Create or Select a Project

Open Google Cloud Console.

  1. Open the project selector.
  2. Click New project or Create project.
  3. Enter a descriptive name, such as Edocman Drive Integration.
  4. Select an organization or location if your account requires it.
  5. Create the project and wait for completion.
  6. Make sure the correct project is selected before continuing.

Project name and Project ID are different values. Use values appropriate for your website; do not copy project names or IDs from old screenshots.

Step 2: Enable Google Drive API

In the selected project:

  1. Open APIs & Services → Library.
  2. Search for Google Drive API.
  3. Open the API page.
  4. Click Enable.

If the API is already enabled, continue to the next step.

Important: Google Drive API must be enabled in the same project that contains the OAuth client used by the plugin.

Step 3: Configure the OAuth Consent Screen

Open Google Auth Platform and complete the initial application setup.

Depending on the Google Cloud interface, settings may appear under Branding, Audience, Data Access, and Clients, or under OAuth consent screen.

Provide the information Google requests, including:

  • An application name that users can recognize.
  • A user support email.
  • Developer contact information.
  • Domain information and related links, where required.

Use your own application name, branding, and website information. Do not copy another product's name, logo, or website from example screenshots.

Select the Audience

Choose the audience that matches your deployment:

  • Internal: For users within your Google Workspace organization, when this option is available.
  • External: For Google accounts outside the organization or personal Google accounts.

If an External application is in Testing status, add the Google account you will use to connect Edocman to the Test users list.

Configure Requested Permissions

The supplied plugin implementation requests these OAuth scopes:

OAuth scope Purpose
https://www.googleapis.com/auth/drive Broad Drive file access for reading, creating, updating, and deleting files
https://www.googleapis.com/auth/userinfo.email Access to the account's email address
https://www.googleapis.com/auth/userinfo.profile Access to basic profile information

Declare the corresponding scopes in the application's data access configuration.

Security notice: This plugin implementation requests the broad drive scope. The Root Path setting organizes documents but does not restrict OAuth access to that folder.

The drive scope is classified by Google as a restricted scope. Verification requirements depend on the application's audience and deployment.

Do not bypass an authorization warning without first checking the application's identity and the permissions it requests.

Testing Status and Token Expiration

For an External application in Testing status that requests Drive access, refresh tokens generally expire after 7 days.

For a long-running website integration, review Google's requirements for moving the application to Production and completing verification when applicable.

Moving an application to Production does not automatically mean that Google has verified it.

Step 4: Create an OAuth Client

  1. Open Google Auth Platform → Clients → Create client.
    • Alternatively, use APIs & Services → Credentials → Create credentials → OAuth client ID.
  2. Select Web application.
  3. Enter a name, such as Edocman Website.
  4. Configure Authorized redirect URIs as described below.
  5. Create the client.

Authorized Redirect URIs

The plugin builds its callback URL from the Joomla root URL followed by:

administrator/index.php?option=com_edocman&task=googledriveauthenticate

If Joomla is installed at the domain root, the callback is:

https://example.com/administrator/index.php?option=com_edocman&task=googledriveauthenticate

If Joomla is installed in a subdirectory named joomla, the callback is:

https://example.com/joomla/administrator/index.php?option=com_edocman&task=googledriveauthenticate

Replace the example domain and installation path with your actual website URL.

The URI registered with Google must exactly match the callback used by the plugin, including:

  • The protocol, normally https.
  • The hostname, including www if used.
  • The port, if applicable.
  • The Joomla installation subdirectory.
  • The path and query string.

Important: Do not use a WordPress callback for Edocman. URLs containing /wordpress/wp-admin/ or wpfdAddon-cloud do not apply to this plugin.

If your website runs behind a reverse proxy or CDN, make sure Joomla detects the correct public hostname and HTTPS protocol.

Authorized JavaScript Origins

The authorization flow shown in the supplied code uses a server-side callback. This flow does not show a requirement for an Authorized JavaScript origin.

If another website component requires this field, enter only the origin, for example:

https://example.com

Do not include a path such as /administrator/. Do not remove www if it is part of the hostname your website uses.

Step 5: Obtain the Client Credentials

After creating the OAuth client, obtain:

  • Client ID
  • Client secret

Keep these values available for the Joomla configuration step.

Keep credentials private: Do not publish Client secrets or OAuth tokens in screenshots, support posts, or public repositories. If a real Client secret has been exposed, replace it in Google Cloud and update the plugin configuration.


3. Connect Joomla to Google Drive

Return to Joomla after completing the Google Cloud configuration.

Step 1: Save the Plugin Credentials

Open EDocman - Google DriveV3 and:

  1. Paste the Client ID into its field.
  2. Paste the Client secret into its field.
  3. Enter a Root Path, such as edocman.
  4. Confirm that Status is Enabled.
  5. Click Save.
  6. Reload or reopen the plugin configuration if necessary.

Save before connecting. The authorization field reads credentials from the saved plugin configuration, not just from values currently entered in the form.

Step 2: Authorize the Google Account

After the credentials have been saved, use the Google Drive connection control in the plugin's authorization area.

  1. Click the connection button.
  2. Select the Google account that will store the documents.
  3. Check the application name.
  4. Review the requested permissions.
  5. Grant access only if the application and permissions match your configuration.
  6. Wait for Google to redirect you back to Joomla.
  7. Reopen the plugin configuration and check the connection status.

If the connection control does not appear:

  • Confirm that the plugin is enabled.
  • Confirm that both credentials have been saved.
  • Reload the configuration page.
  • Check any displayed errors and the relevant logs.

Screenshot note: The configuration image above shows the credential fields, but not the authorization control or a successful connection status.

Step 3: Test the Complete Workflow

A successful Google consent screen alone does not confirm that document storage and retrieval work correctly.

Perform this test:

  1. Create a test document in Edocman using a small PDF file.
  2. Save the document.
  3. Open Google Drive using the connected account.
  4. Confirm that the file appears in the folder managed by the plugin.
  5. Download the document from the website frontend using an authorized account.
  6. Confirm that an account without permission cannot download it.

The plugin may add a unique prefix to uploaded filenames to avoid collisions. The physical filename on Google Drive can therefore differ from the original filename.


4. Storage Behavior, Safety, and Troubleshooting

Understand how the plugin manages folders and files before using it with production documents.

Root Folder Behavior

The plugin manages its root folder using the Root Path name and a Google Drive folder ID stored in the Joomla database.

  • The default name is edocman.
  • The root folder is created when the storage system is initialized, such as during an upload operation.
  • If no folder mapping exists, or the mapped folder cannot be accessed, the plugin may attempt to create another folder.
  • The supplied implementation does not show a process that adopts an existing folder solely because its name matches Root Path.

If Edocman's hierarchical folder structure setting is enabled, the plugin creates category-related folders.

If hierarchical folder structure is disabled, files are uploaded to the root folder.

Avoid unplanned changes: Do not change Root Path or the connected Google account after storing production documents without a migration plan. Files and folders are linked by IDs in the database; changing a name or account does not automatically migrate them.

Temporary Files and Server Limits

In the supplied upload flow, the plugin:

  1. Saves the upload in tmp/edupload.
  2. Reads the file content and sends it to Google Drive.
  3. Removes the temporary file when the upload flow completes successfully.

Your server still needs:

  • Free space for temporary uploads.
  • Write permission for the temporary directory.
  • Appropriate PHP upload limits.
  • Sufficient PHP memory and execution time.

Google Drive storage does not eliminate server resource limits. Reading an entire file into memory can cause problems with large uploads.

Document Deletion

The supplied plugin code includes an Edocman document deletion event that calls the Google Drive API to delete the corresponding file.

Deletion warning: The API operation deletes the file rather than moving it to Google Drive's trash. Test deletion only with sample documents and maintain an independent backup of important files.

The exact user-facing behavior depends on when Edocman triggers the deletion event. Distinguish permanent deletion from moving a Joomla record to the trash, and test both behaviors before deployment.

Features That Should Not Be Assumed

Enabling the plugin does not, by itself, establish that it will:

  • Migrate all existing server files to Google Drive.
  • Import files added directly to Google Drive into Edocman.
  • Synchronize every change in both directions.
  • Support Shared Drives.
  • Handle Google Docs, Sheets, and Slides exactly like ordinary uploaded files.

Test these requirements separately before relying on them. Use an ordinary file such as a PDF for the initial connection test.

Common Problems

Use the following checks to narrow down connection and storage problems.

Problem What to check
redirect_uri_mismatch Exact match of protocol, hostname, Joomla subdirectory, path, and query string
invalid_client Correct Client ID and Client secret from the same OAuth client; saved plugin settings
access_denied Test user membership, declined permissions, or Google Workspace restrictions
Unverified application warning Application identity, requested scopes, deployment status, and verification requirements
API not enabled Google Drive API is enabled in the OAuth client's project
Authorization succeeds but upload fails Drive storage, permissions, temporary directory, PHP limits, and API errors
File cannot be retrieved File existence, account access, and the validity of stored file/folder IDs
Connection fails after about one week Whether an External application is still in Testing status

These checks address common causes, but runtime failures may also require a plugin code review.

Check the Logs

Some plugin errors are recorded in:

administrator/logs/edocman_googledrive.php

This path is relative to the Joomla installation directory.

Not every error is written to this file. Also check Joomla and PHP logs when necessary.

Before sharing logs for support, remove tokens, Client secrets, and other sensitive information.

Disconnect and Reauthorize

If the plugin interface provides a disconnect control, use it to revoke the token and clear the stored authorization credentials.

You can also revoke the application's access from your Google account's connected applications settings.

After access is revoked, the old connection will no longer work. Authorize the application again before attempting further Drive operations.

Deployment Checklist

Before storing production documents, confirm that:

  • The correct Google account is connected.
  • Google Drive API is enabled in the correct project.
  • The callback URI matches the website exactly.
  • OAuth audience and deployment settings are appropriate.
  • Uploading a sample file works.
  • Downloading the sample file works.
  • Website access permissions behave as expected.
  • Deletion behavior has been tested using disposable files.
  • Important documents have an independent backup.

References