Gmail OAuth Setup
What it is
This guide configures Google OAuth so JobOps can read recruitment emails from Gmail for the Tracking Inbox.
Why it exists
Gmail OAuth setup is easy to misconfigure (wrong redirect URI, missing refresh token, or unnecessary scopes). This page documents the exact defaults JobOps expects.
How to use it
1) Create Google Cloud credentials
- Create (or select) a project.
- Open APIs & Services → Library and enable Gmail API.
- Open APIs & Services → OAuth consent screen and configure your app.
- Open APIs & Services → Credentials and create OAuth client ID.
- Choose Web application.
- Add at least one authorized redirect URI:
- Local:
http://localhost:3005/oauth/gmail/callback - Production:
https://your-domain.com/oauth/gmail/callback
Notes:
- If you set
GMAIL_OAUTH_REDIRECT_URI, it must exactly match a redirect URI in Google Cloud. - JobOps does not require JavaScript origins for this flow.
2) Set environment variables
Configure:
GMAIL_OAUTH_CLIENT_ID=your-client-id.apps.googleusercontent.com
GMAIL_OAUTH_CLIENT_SECRET=your-client-secret
# Optional (recommended in production)
GMAIL_OAUTH_REDIRECT_URI=https://your-domain.com/oauth/gmail/callback
Then restart the container/app.
3) Connect Gmail in JobOps
- Open Tracking Inbox.
- Click Connect Gmail.
- Complete Google consent.
JobOps starts OAuth with:
- Scope:
https://www.googleapis.com/auth/gmail.readonly access_type=offline(requests refresh token)prompt=consent(forces consent screen so refresh token is returned reliably)
4) Scope reference (required vs not required)
Required by JobOps:
https://www.googleapis.com/auth/gmail.readonly
Not required for JobOps Gmail ingestion:
https://www.googleapis.com/auth/gmail.modifyopenidhttps://www.googleapis.com/auth/userinfo.emailhttps://www.googleapis.com/auth/userinfo.profile
Common problems
Redirect URI mismatch
- Symptom: Google returns
redirect_uri_mismatch. - Fix: ensure the exact callback URL in
GMAIL_OAUTH_REDIRECT_URIis also present in the OAuth client redirect URIs.
No refresh token returned
- Symptom: connect fails after OAuth exchange.
- Fix: remove app access in your Google account, then reconnect so consent is re-granted.
Gmail connects but no inbox results
- Check that your account actually has recruitment/application emails.
- Trigger a sync and increase
searchDaysif needed.