Google OAuth Setup
Google Drive sync requires OAuth credentials from Google Cloud Console.
Setup Steps
1. Create a Google Cloud Project
- Go to Google Cloud Console
- Create a new project (or select an existing one)
- Enable the Google Drive API (APIs & Services > Library)
2. Create OAuth Credentials
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Configure the consent screen if prompted (External, app name: ThinkUtils)
- Application type: Desktop app
- Name: ThinkUtils Desktop
- Click Create
3. Add Redirect URI
In your OAuth client settings, add:
http://localhost:8765/callback4. Configure the App
Replace the placeholder values in src-tauri/src/sync.rs:
rust
const GOOGLE_CLIENT_ID: &str = "YOUR_CLIENT_ID.apps.googleusercontent.com";
const GOOGLE_CLIENT_SECRET: &str = "YOUR_CLIENT_SECRET";5. Rebuild
bash
npm run tauri buildHow It Works
- User clicks Login — opens Google OAuth in browser
- User authorizes ThinkUtils for Google Drive access
- OAuth redirects to
localhost:8765/callback - App exchanges auth code for access token
- Settings sync as
thinkutils_settings.jsonin Google Drive root
Security
- Access tokens stored locally in
~/.config/thinkutils/sync_state.json - Only the Google Drive File scope is requested (not full Drive access)
- Tokens are never transmitted except to Google's OAuth servers
Troubleshooting
| Problem | Solution |
|---|---|
| "Invalid client" error | Verify Client ID and Secret; check redirect URI in Cloud Console |
| "Access denied" error | Ensure Google Drive API is enabled; check consent screen config |
| Callback timeout | Ensure port 8765 is not blocked by firewall |