Minimum required version: 2026.2-net48 or 2026.3 (net8)
Salesforce connected apps can enable OAuth refresh token rotation. This feature is required for apps published on Salesforce AppExchange.
When refresh token rotation is enabled, Salesforce returns a new refresh token after authentication and invalidates the previous refresh token and access token.
Riva Sync supports refresh token rotation in both single-node and multi-node environments.
Single-Node Environments
After authentication, in a single-node environment, the Sync process saves the connection with the new refresh token.
This ensures that Sync can continue to authenticate normally after a cold start. The save does not trigger a reload or interrupt normal sync operations.
Multi-Node Environments
In a multi-node environment, authentication is managed by one or more Riva Administration Service (RAS) nodes.
When a Sync node needs to authenticate, it calls RAS, which handles authentication with Salesforce. RAS performs the following actions:
- Caches the Salesforce access token, also known as the session ID.
- Saves the connection with the new refresh and access tokens, along with the dates they were issued.
- Returns the session information to the requesting Sync node.
When RAS first starts, it rebuilds its session cache based on the stored access token, its issue date, and the configured cache-entry expiry time.
Future requests to RAS use the cached session while it remains valid. If Sync receives an invalid-session error, RAS invalidates the cached session and reauthenticates. All Sync nodes receive the same cached session ID when requesting a login.
Load-Balanced RAS Nodes
In a multi-node environment with load-balanced RAS nodes, each RAS node detects connection-file updates made by another RAS node following a session refresh.
The RAS node updates its internal cache using the saved credentials without triggering a policy reload.
Connection Save Behaviour
Normally, saving a connection causes Riva Sync to reload the connection and restart its running processes.
When refresh token rotation management is enabled, Riva Sync recognizes connection saves performed as part of refresh token rotation and continues running without reloading the connection or interrupting sync operations.
Riva also manages session caching and connection updates to help prevent unnecessary reloads in multi-node environments.