OAuth has disconnected

Estimated reading: 3 minutes

Receiver platforms that use OAuth — Google Sheets, Google Calendar, Google Drive, HubSpot, Pipedrive, Constant Contact, Salesforce, the Zoho family, and others — periodically lose their authorisation. Symptoms: 401 Unauthorized errors in the log, the platform status flipping from Connected to Not Connected, or the lists / fields dropdown going empty.

Step 1 — Re-authorize

This is the fix in 9 out of 10 OAuth cases.

  1. Go to AFI > Settings and open the platform’s tab.
  2. Scroll to the bottom and click Reconnect / Authorize.
  3. Approve the OAuth prompt with the same account that owns the data.
  4. Status should switch to Connected. Run a test submission.

Step 2 — Confirm permalinks are set to Post name

WordPress’s default Plain permalinks break OAuth callbacks for many platforms (Constant Contact, Google services, Pipedrive).

  1. Go to Settings > Permalinks.
  2. Select Post name.
  3. Click Save Changes (no other change needed — saving rewrites the rules).
  4. Re-authorize the platform in AFI.

Step 3 — Confirm the redirect URI matches

If the platform’s OAuth app shows a redirect URI that doesn’t exactly match what AFI is sending, you’ll get 400 Redirect URI mismatch errors.

  • Google Sheets / Drive / Calendar: in Google Cloud Console, the authorised redirect URI must be the exact value shown on AFI’s settings page — including trailing slash and protocol.
  • Salesforce: same — set the Connected App’s redirect URI to the AFI value exactly.
  • Zoho: pick the correct data centre (.com / .eu / .in / .com.au / .com.cn / .jp).

Step 4 — Constant Contact specific gotchas

  • OAuth keeps becoming “Unauthorized” / 401 after working — re-authorize via Settings > Constant Contact. Improved in v1.126.6.
  • 409 Conflict turning into 401 on resend — caused by capital letters in the email address. Fixed in v1.126.9.
  • Lists / tags don’t appear after authorize — permalinks must be Post name. Save permalinks, re-authorize.
  • Status connected, then unconnected on form edit — same permalinks fix.
  • “No API Secret Key” in Constant Contact — in the CC developer portal, create the app with Authorization Code Flow + Implicit Flow and Rotating Refresh Tokens enabled. A second app attempt usually shows the option correctly.

Step 5 — Google services token refresh issues

  • Reconnect required every 15 minutes — token refresh bug; fixed in recent plugin versions. Update AFI and re-authorize with full scopes.
  • 403 access denied / 400 redirect URI mismatch — save the Redirect URI in Google Cloud Console exactly as AFI shows it. Don’t click “PREPARE FOR VERIFICATION” in the OAuth consent screen — leave it in Testing.
  • No spreadsheets / calendars appear after Connected — Google Drive scope missing from the consent screen. Add Drive + Sheets API scopes per the docs.

Step 6 — When all else fails

  1. Update AFI to the latest version.
  2. Delete the existing credentials in AFI > Settings > [Platform].
  3. Regenerate the credentials on the platform side (new API key, new OAuth client).
  4. Re-paste and re-authorize.

Related