Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Eraiyanbupeterfrancis/AutoBackupTool/llms.txt

Use this file to discover all available pages before exploring further.

This page walks you through creating OAuth2 credentials in Google Cloud Console, downloading client_secrets.json, and authorizing AutoBackupTool to access your Google Drive. You only need to complete this setup once — after the first authorization, AutoBackupTool saves your token and reuses it automatically.
1

Create or select a Google Cloud project

Go to Google Cloud Console and sign in with your Google account. In the top navigation bar, click the project dropdown and either select an existing project or click New Project to create one for AutoBackupTool.
2

Enable the Google Drive API

Navigate to APIs & Services > Library in the left sidebar. Search for Google Drive API and click on it in the results. Click Enable to activate the API for your project.
3

Create OAuth client credentials

Go to APIs & Services > Credentials. Click Create Credentials and select OAuth client ID from the dropdown. When prompted for the application type, choose Desktop app, give it a name, and click Create.After the credential is created, click Download JSON in the confirmation dialog (or click the download icon next to the credential in the list). Rename the downloaded file to client_secrets.json.
4

Add test users (if your consent screen is in Testing mode)

If your OAuth consent screen is set to Testing status, only explicitly listed Google accounts can authorize the app. To add your account, go to APIs & Services > OAuth consent screen, scroll down to the Test users section, and click Add users. Enter your Google email address and save.You can check your consent screen status on the same OAuth consent screen page — it displays Testing or In production near the top.
5

Place client_secrets.json in your project directory

Move client_secrets.json into the AutoBackupTool project folder — the same directory that contains backup_gui.py. AutoBackupTool looks for this file relative to where you run the app.
AutoBackupTool/
├── backup_gui.py
├── backup_utils.py
├── backup.env
├── client_secrets.json   ← place it here
└── ...
6

Set CLIENT_SECRETS_FILE in backup.env

Open your backup.env file and confirm the CLIENT_SECRETS_FILE variable points to your credentials file:
CLIENT_SECRETS_FILE=client_secrets.json
If you placed client_secrets.json somewhere else, use its path (relative to backup_gui.py or an absolute path).

First-run authorization

The first time you run backup_gui.py, AutoBackupTool opens a browser window so you can sign in and grant it access to your Google Drive. After you approve, the token is saved locally to mycreds.txt. All subsequent runs use the saved token without reopening the browser. Here is how AutoBackupTool handles credentials on every run (backup_utils.py):
gauth.LoadCredentialsFile("mycreds.txt")
if gauth.credentials is None:
    gauth.LocalWebserverAuth()
    gauth.SaveCredentialsFile("mycreds.txt")
elif gauth.access_token_expired:
    gauth.Refresh()
    gauth.SaveCredentialsFile("mycreds.txt")
else:
    gauth.Authorize()
  • If mycreds.txt does not exist, the browser flow runs and the token is saved.
  • If the token has expired, it is refreshed automatically and the updated token is saved back to mycreds.txt.
  • If the token is valid, it is used directly — no browser interaction required.
mycreds.txt is the cached OAuth token written by GoogleAuth.SaveCredentialsFile. As long as this file exists and the token is valid (or can be refreshed), AutoBackupTool will authenticate silently on startup.
Never commit client_secrets.json or mycreds.txt to git. Both files contain sensitive credentials that give access to your Google Drive. Add them to your .gitignore immediately — see the environment variables page for the recommended .gitignore entries.

Build docs developers (and LLMs) love