\\
__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.\\
\\
__!!! 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__\\ 
\\
----
!1. Google OAuth 2.0 Configuration\\
\\
Start by navigating to Google APIs & Services: [Google APIs & Services Link|https://console.developers.google.com/projectselector/apis/credentials]\\
__!!!Note:__ Ensure sure the __Google Drive API__ is enabled at __Enabled APIs & services__. [Google API Library Link|https://console.cloud.google.com/apis/library]\\
\\
[SMTP Google Mail Integration/g_api_services.png]\\
[attachments|enable_api.png]\\
\\
Go to the __Credentials__ menu, click on __Create Credentials__, and select __OAuth client ID__:\\
[SMTP Google Mail Integration/create_credentials.png]\\
\\
Select the application type: __Web application__. Provide a unique name. Then, configure the __Authorized redirect URI__—this is where Google will redirect you after authorization. The Redirect URL must end with __?command=register_gdrive_api__.\\
\\
{{{

    http://127.0.0.1:9090/?command=register_gdrive_api
}}}\\
or
{{{
    
    https://your.crushftp.domain.com/?command=register_gdrive_api
    
}}}\\
Finally, click the __Create__ button.\\
\\
[SMTP Google Mail Integration/credential_config_gdrive.png]\\
\\
After the credentials are created, copy the __Client ID__ and __Client Secret__.\\
\\
[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.__\\
----
!2. Gdrive Remote Item Settings:\\
\\
Select the __GDrive__ item type and click the __Get Refresh Token__ button.\\
[GDriveSetup/get_refresh_token.png]\\
\\
__!!! Note__: 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.\\
 __!!! Note__: 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.\\