- What OAuth is and why it matters for your privacy
- Understanding Client ID, Client Secret, and scopes
- How to create OAuth credentials for Google Drive
- How to create OAuth credentials for OneDrive
- Which scopes to choose for different use cases
Understanding OAuth
OAuth (Open Authorization) is a standard protocol that allows applications to access your data without exposing your password. When you connect Google Drive or OneDrive to FileFortress, OAuth is what makes that connection possible.
Why Bring Your Own OAuth?
When you use FileFortress's default OAuth application, you're using credentials shared with all other users. By creating your own OAuth app, you get:
- Complete privacy — FileFortress never touches your access tokens
- Full control — You decide exactly which permissions (scopes) to grant
- Independent quota — Your own API limits, not shared with other users
- Audit trail — See exactly what apps access your data in your provider's dashboard
Key Concepts
Client ID
A public identifier for your OAuth app. Think of it like a username that tells Google or Microsoft which app is requesting access.
Client Secret
A confidential password for your OAuth app. This proves that the app requesting access is really yours. Keep this secure and never share it.
Understanding Scopes
Scopes define what permissions your OAuth app requests. They're like a list of things you're allowing FileFortress to do with your cloud storage. Common scopes include:
| Scope | What It Allows | When to Use |
|---|---|---|
| drive.readonly | Read files and folders only | When you only need to search and view files |
| drive | Full read/write access to Drive | When you need to modify or delete files |
| Files.Read | Read files in OneDrive | Basic read-only access for OneDrive |
| Files.ReadWrite.All | Full access to all files | When you need write access to OneDrive |
For most FileFortress users, read-only scopes are sufficient. FileFortress only needs to read file metadata to build your search index. Only grant write access if you plan to use features that modify files.
Google Drive Setup
Follow these steps to create OAuth credentials for Google Drive:
Step 1: Access Google Cloud Console
Go to the Google Cloud Console and sign in with your Google account.
Step 2: Create a New Project
- Click the project selector dropdown at the top of the page
- Click New Project
- Enter a project name (e.g., "FileFortress OAuth")
- Click Create
You can use an existing project if you prefer, but creating a dedicated project keeps things organized and makes it easier to manage permissions later.
Step 3: Enable the Google Drive API
- With your project selected, go to APIs & Services → Library
- Search for "Google Drive API"
- Click on Google Drive API
- Click Enable
Step 4: Configure the OAuth Consent Screen
- Go to APIs & Services → OAuth consent screen
- Select External as the user type (unless you're a Google Workspace user)
- Click Create
- Fill in the required fields:
- App name: FileFortress (or any name you'll recognize)
- User support email: Your email address
- Developer contact information: Your email address
- Click Save and Continue
- On the Scopes screen, click Add or Remove Scopes
- Select the scopes you need (see recommendations below)
- Click Save and Continue
- On the Test users screen, add your Google account email if you're testing
- Click Save and Continue
Step 5: Create OAuth Credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Select Desktop app as the application type
- Enter a name (e.g., "FileFortress Desktop")
- Click Create
- You'll see a popup with your Client ID and Client Secret
- Copy both values and store them securely — the Client Secret will not be shown again!
If you lose your Client Secret, you'll need to create new credentials. You cannot retrieve the secret after closing the popup.
Recommended Scopes for Google Drive
# For read-only access (recommended for most users)
https://www.googleapis.com/auth/drive.readonly
# For full read/write access (only if needed)
https://www.googleapis.com/auth/drive
OneDrive Setup
Follow these steps to create OAuth credentials for OneDrive:
Step 1: Access Azure Portal
Go to the Azure Portal and sign in with your Microsoft account.
You don't need an Azure subscription to create OAuth apps. The free tier of Azure Active Directory is sufficient.
Step 2: Register a New Application
- Go to Microsoft Entra ID (or search for "App registrations")
- Click App registrations in the left sidebar
- Click New registration
- Fill in the registration form:
- Name: FileFortress (or any name you'll recognize)
- Supported account types: Accounts in any organizational directory and personal Microsoft accounts
- Redirect URI: Select "Public client/native (mobile & desktop)" and enter:
http://localhost:0
- Click Register
Step 3: Get Your Credentials
After registration, you'll be taken to your app's overview page:
- Copy the Application (client) ID — this is your Client ID
- In the left sidebar, click Certificates & secrets
- Click New client secret
- Enter a description (e.g., "FileFortress Secret")
- Select an expiration period (we recommend 24 months)
- Click Add
- Copy the secret Value immediately — it will not be shown again!
Step 4: Configure API Permissions
- In your app registration, click API permissions in the left sidebar
- Click Add a permission
- Select Microsoft Graph
- Select Delegated permissions
- Search for and add the scopes you need (see recommendations below)
- Click Add permissions
Recommended Scopes for OneDrive
# For read-only access (recommended for most users)
Files.Read
User.Read
# For full read/write access (only if needed)
Files.ReadWrite.All
User.Read
offline_access
The offline_access scope allows FileFortress to refresh your access tokens automatically. Without this, you'll need to re-authenticate every hour. We recommend including this scope for a better user experience.
Using Your Credentials with FileFortress
Now that you have your Client ID and Client Secret, you can connect your cloud storage:
# Start the interactive OAuth setup
filefortress remotes add oauth
# Or specify everything upfront (non-interactive)
filefortress remotes add oauth \
--provider gdrive \
--name "My Google Drive" \
--client-id YOUR_CLIENT_ID \
--client-secret YOUR_CLIENT_SECRET
# For OneDrive
filefortress remotes add oauth \
--provider onedrive \
--name "My OneDrive" \
--client-id YOUR_CLIENT_ID \
--client-secret YOUR_CLIENT_SECRET
Security Best Practices
🔒 Keep Secrets Secure
Never commit your Client Secret to version control. Use environment variables or secret files.
📝 Audit Regularly
Review your OAuth app's activity in Google Cloud Console or Azure Portal periodically.
🚫 Use Minimum Permissions
Only request scopes you actually need. Read-only is sufficient for most FileFortress use cases.
🔄 Rotate Secrets
Create new credentials periodically and delete old ones to maintain security.
Google and Microsoft apps start in "Testing" mode, which works fine for personal use. If you hit user limits (Google allows 100 test users), you may need to submit your app for verification. For personal use with FileFortress, Testing mode is typically sufficient.
Troubleshooting
"App is not verified" Warning
Both Google and Microsoft may show a warning that your app isn't verified. This is normal for personal OAuth apps. Click "Advanced" or "Continue anyway" to proceed. Your app is only accessing your own data, so this warning is just a standard security measure.
Invalid Client or Unauthorized
- Double-check you've copied the Client ID and Secret correctly
- Ensure the OAuth consent screen is configured (for Google)
- Verify the correct API permissions/scopes are added
- For Google: Make sure you're added as a test user if the app is in Testing mode
Token Refresh Failures
If your connection stops working after some time:
- For Google: Ensure the app isn't in "Publishing status: In production" without verification if you have sensitive scopes
- For Microsoft: Check that the
offline_accessscope was included - Try reconfiguring the remote:
filefortress remotes add oauth --reconfigure
Related Articles
- Why FileFortress Never Sees Your Tokens — Learn more about the privacy benefits of BYO OAuth
- remotes Command Reference — Complete documentation for the remotes add oauth command
- Multi-Device Setup — Using your OAuth credentials across multiple devices