At line 1 removed 4 lines |
GDrive requires several steps to configure. |
It requires several steps to configure.\\ |
You will start at Google API's and Service:\\ |
[https://console.developers.google.com/projectselector/apis/credentials]\\ |
At line 6 changed one line |
Setup Oauth Consent (if was not yet created), make an internal one: \\ |
__Google Drive REST API v3__ based integration: [Google Drive API Link|https://developers.google.com/workspace/drive/api/reference/rest/v3] Authentication is handled through __OAuth 2.0__ ([OAuth Wikipedia Link|https://en.wikipedia.org/wiki/OAuth]), ensuring secure, user-consented access to Google Drive data.\\ |
At line 8 changed one line |
[attachments|SMTP Google Mail Integration/create_consent.png]\\ |
---- |
__⚠️ Proxy Configuration:__ If your server accesses the internet through a proxy, make sure to whitelist the following domains for Google Authentication and Drive access:\\ |
- __oauth2.googleapis.com__\\ |
- __www.googleapis.com__\\ |
At line 10 changed one line |
Set the support emails, the application domain and save it. |
---- |
!1. Google OAuth 2.0 Configuration\\ |
At line 12 changed 2 lines |
[attachments|SMTP Google Mail Integration/consent_settings_1.png]\\ |
[attachments|SMTP Google Mail Integration/consent_settings_2.png]\\ |
Start by navigating to Google APIs & Services: [Google APIs & Services Link|https://console.developers.google.com/projectselector/apis/credentials]\\ |
__⚠️ Important:__ Ensure the __Google Drive API__ is enabled at __Enabled APIs & services__. [Google API Library Link|https://console.cloud.google.com/apis/library]\\ |
At line 15 changed 2 lines |
Go to the Credentials menu and create new credentials, choose OAuth client ID:\\ |
[attachments|SMTP Google Mail Integration/create_credentials.png]\\ |
[SMTP Google Mail Integration/g_api_services.png]\\ |
[attachments|enable_api.png]\\ |
At line 18 changed one line |
Choose Web application: |
Go to the __Credentials__ menu, click on __Create Credentials__, and select __OAuth client ID__:\\ |
[SMTP Google Mail Integration/create_credentials.png]\\ |
At line 20 changed one line |
[attachments|SMTP Google Mail Integration/credential_config.png]\\ |
• Select the application type: __Web application__.\\ |
• Provide a unique name to identify your OAuth client (e.g., CrushFTP Integration).\\ |
Then configure the following:\\ |
• __Authorized JavaScript origins__: Add the base URL of your CrushFTP server (e.g., https://your-domain.com).\\ |
• __Authorized redirect URIs__: This is the URL Google will redirect to after successful authorization. The Redirect URL must end with __?command=register_gdrive_api__\\ |
At line 22 removed one line |
It is required to set up the Authorized Redirect URIs. You can put a domain (where your CrushFTP is available), or localhost. The URI needs to end with:\\ |
At line 24 changed one line |
?command=register_gdrive_api |
|
http://127.0.0.1:9090/?command=register_gdrive_api |
or |
https://your.crushftp.domain.com/?command=register_gdrive_api |
At line 26 changed 2 lines |
!!! CrushFTP admin page url must match with the redirect url. In our example: http://localhost:9090\\ |
[attachments|credential_config.png]\\ |
---- |
__⚠️ Important:__ For [CrushOIDC] Plugin the __Redirect URL__ must be added in the following format: |
{{{ |
https://www.your.crushftp.com/SSO_OIDC/ |
}}}\\ |
It is important that the URL ends with __/SSO_OIDC/__, as required by the [CrushOIDC] integration.\\ |
---- |
Finally, click the __Create__ button.\\ |
At line 29 changed 3 lines |
And one last important step, you need to enable the GoogleDrive API for your account if its not already.\\ |
[https://console.developers.google.com/apis/library/drive.googleapis.com/]\\ |
[attachments|enable_api.png]\\ |
[SMTP Google Mail Integration/credential_config_gdrive.png]\\ |
At line 33 changed 14 lines |
Now that the API is enabled, and your credentials are setup, and your redirect domains are configured, you can use the credentials in CrushFTP to get your google auth token and get access.\\ |
In the User Manager, add a new remote VFS item type and set the protocol to be "GDrive".\\ |
Take your google client_id and secret and combine them together with a tilda as separator:\\ |
{{{ |
client_id: 725111111110-7kaimtXXXXXXXXXXXXXXXXXXXXX64m4k.apps.googleusercontent.com |
secret: fEsXXXXXXXXXXXXXXXXPggg7 |
}}} |
results in: |
{{{ |
725111111110-7kaimtXXXXXXXXXXXXXXXXXXXXX64m4k.apps.googleusercontent.com~fEsXXXXXXXXXXXXXXXXPggg7 |
}}} |
That whole long string becomes your "username" to GDrive://.\\ |
Copy and paste it into the user field. Then click "Get Refresh Token" to finish the config.\\ |
[attachments|get_refresh_token.png]\\ |
After the credentials are created, copy the __Client ID__ and __Client Secret__.\\ |
At line 48 changed 2 lines |
Finally!\\ |
[attachments|test_success.png]\\ |
[SMTP Google Mail Integration/client_id_secret.png]\\ |
\\ |
__⚠️ Note:__ You can configure the __OAuth consent screen__ by clicking the link above the __Authorized JavaScript origins__ section:\\ |
"The domains you enter in the fields below will be automatically added to your __OAuth consent screen__ as __authorized domains__."\\ |
Click the link to open the __OAuth consent screen__ settings, complete the configuration, and authorize your __CrushFTP domain.__\\ |
__Important__: After configuration, don’t forget to click __Publish App__ at __Audience__ page to make it active. Without publishing, the app will remain in __Testing__ mode, which restricts access to authorized test users only.\\ |
---- |
!2. Gdrive Remote Item Settings:\\ |
\\ |
Select the __GDrive__ item type and click the __Get Refresh Token__ button.\\ |
[GDriveSetup/get_refresh_token.png]\\ |
\\ |
__⚠️ Important__: To obtain the __Refresh Token__, the CrushFTP WebInterface’s host and port must match the __Redirect URL__ specified in the __Google APIs & Services__-> __Credentials__ -> __OAuth 2.0 Client IDs__. In our example, it was: http://127.0.0.1:9090 or https://your.crushftp.domain.com/\\ |
\\ |
Enter the __Client ID__ , __Client Secret__. Proceed with the authentication and authorization process.\\ |
__⚠️ Important__: Be sure to sign in with the __Google Account__ that has the __necessary permissions__, as configured in the __Google APIs & Services__-> __Credentials__ -> __OAuth 2.0 Client IDs__. This will automatically configure the __User name__ and __Password__.\\ |
[GDriveSetup/gdrive_oauth_form.png]\\ |
\\ |
If the domain is unverified, a warning message may appear. Click __Advanced__ and choose to proceed:\\ |
\\ |
[SMTP Google Mail Integration/not_verified_domain.png]\\ |
\\ |
Click on the __Allow__ button:\\ |
\\ |
[SMTP Google Mail Integration/allow_form.png]\\ |
\\ |
[GDriveSetup/test_success.png]\\ |
\\ |
__Enable Team Drive__: Enable this option to allow access to __Shared Drives__ (formerly Team Drives) in Google Drive. When selected, file operations will include content stored in Shared Drives, not just the user’s personal My Drive. This is useful when your organization collaborates using __Google Workspace Shared Drives__.\\ |
\\ |
__Keep File ID on Overwrite__: Enable this option to __retain the original file’s ID when overwriting a file__ in Google Drive. Instead of deleting and re-uploading the file (which generates a new ID), the existing file is updated in-place. This ensures that any shared links or references to the file remain valid after an overwrite.\\ |
\\ |
__Enable MDTM__: Activates support for the __MDTM__ (Modification Time), which allows clients to set the last modified timestamp of a file after the upload action. This can be useful for synchronization tools and backup software that rely on accurate file timestamps.\\ |
\\ |
__Corpora variable name__: It defines the logical __buckets__ of content that Google Drive should search within. It’s especially important in complex Drive environments where you may be working across personal drives, shared drives (Team Drives), or content shared with you by others.\\ |
Values:\\ |
- user: Search within the current user’s My Drive.\\ |
- drive: Search within a specific Shared Drive (must be used with driveId).\\ |
- allDrives: Search across the user’s My Drive and all accessible Shared Drives.\\ |
- domain: Search all files in the user’s domain (only works with G Suite / Workspace).\\ |
\\ |
|
|
|
|