\\
__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]\\
\\
----
!2. Gdrive Remote Item Settings:\\
\\
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.\\
__CrushFTP admin page url must match with the redirect url.__ In our example: http://XXXXcrushftp.com\\
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]\\
\\
Finally!\\
[attachments|test_success.png]\\