OAuth2 token refresh failures

OAuth2 token refresh mechanism on the platform.

The SnapLogic Platform refreshes the OAuth2 tokens automatically every 20 minutes for accounts that are set to auto-refresh. Failures can occur for several reasons, such as:

  • Incorrect OAuth configuration settings

  • Expired credentials (outdated API keys or access tokens)

Stale account status

The SnapLogic Platform detects failures in the OAuth token refresh process and marks accounts that fail 18 times as stale. This mechanism prevents the refresh of the auto-refresh for the accounts marked as stale. This applies only to accounts that have the auto-refresh functionality enabled. You can view the stale accounts in the Activity log as shown below:


Accounts marked as stale in Activity Log
You can create a notification rule to receive alerts (via email and Slack) for stale accounts. After you set up a notification rule, you will receive an email or Slack notification similar to the example shown below:
OAuth2 Account Stale Account Alert on Slack

Content-Type header rejected by token endpoint

When using a SnapLogic OAuth2 account, the token request fails for certain endpoints that strictly validate the Content-Type header. SnapLogic sends token requests with:

Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Some OAuth2 token endpoints only accept the RFC-standard form without the charset parameter:

Content-Type: application/x-www-form-urlencoded

The additional charset=UTF-8 parameter causes the request to be rejected with the error:

Content-Type must be set to application/x-www-form-urlencoded

Resolution: Disable UTF-8 encoding using the following feature flag, set at the environment (Org) level:

com.snaplogic.cc.account.oauth2.OAuth2Client.UTF8_ENCODE

Set the flag to false to send the Content-Type header without the charset=UTF-8 parameter.

We recommend that you enable this feature flag in your development environments before production environments. Consult your CSM about enabling the feature flag for your Environment (Org).