I got the following notification in Heroku Connect:
Authorization to Salesforce has expired. Please re-authorize Heroku Connect to access your Salesforce data.
and the synchronization stopped until I re-authenticated with Salesforce.
Why did this happen and how can I prevent this from happening again?
When this happens, the Heroku Connect connection stays in the
UNAUTHORIZED state until you re-authenticate/re-enable the connection with Salesforce.
Heroku Connect doesn't have any insight or control over your Salesforce authorization expirations. Your Salesforce administrator or Salesforce support may be able to assist in determining the cause of the expiration.
The Salesforce token is designed to expire frequently but Heroku Connect should be able to renew the token transparently even if it's been expired. Re-authenticating your connection is needed and expected in a few cases:
- Your Salesforce Org is moved from one instance to another, or for some other reason your Salesforce instance is refreshed.
- Salesforce Org admins have configured an expiration on refresh tokens, preventing Heroku Connect from being able to refresh the token after that's been expired.
There are a few more details on Connected App Behavior that you can read about from Salesforce docs.
See also: Heroku Connect Log Errors: Reauthorizarion Required