How watsonx Orchestrate manages OAuth2 tokens
When a user authorizes an OAuth2 connection through the watsonx Orchestrate UI, the platform performs the authorization code exchange and stores two tokens on behalf of that user:
On each tool invocation, watsonx Orchestrate checks whether the stored
access_token is still valid. If it is expired, watsonx Orchestrate automatically calls the provider’s token endpoint with the stored refresh_token to obtain a new access_token, then retries the tool call, without requiring to reauthorize.
OAuth-based connections currently work when the user interacts with the agent through the watsonx Orchestrate UI (not embedded web chat). See Why use connections for a full compatibility matrix.
Refresh tokens are issued when offline_access is requested
The most common reason that a tool works initially but stops working after the first token expiry is a missing refresh token. OAuth2 providers issue a refresh_token when the authorization request explicitly includes the offline_access scope (or an equivalent provider-specific scope). If offline_access is omitted, the provider issues an access_token with no way to renew it. When that token expires, every subsequent tool call fails with an authentication error.
Make sure the offline_access scope is included in your connection’s scope list at the time of initial authorization. Adding it after the fact requires the user to reauthorize the connection from the beginning. You cannot back-fill a refresh token.
Required scopes by catalog tool
The following table lists the minimum scopes required for common catalog integrations. Scopes markedrequired for refresh must be included or the connection will stop working after the first access_token expiry.
Setting scopes when configuring an OAuth connection
Scopes are set as part of theset-credentials step for any auth-code or password flow connection. Pass a space-separated list of scope values to the --scope flag:
BASH
set-credentials separately to supply the scope list and other sensitive values.
There is no dedicated “Scopes” field in the Connections Management UI. Scopes are configured exclusively through the CLI
set-credentials command. If you need to change the scope list for an existing connection, rerun set-credentials with the updated --scope value and then have each affected user reauthorize the connection.What happens when a token expires
Troubleshooting: tool stops working after initial authorization
If a tool that was working correctly starts returning authentication errors, follow these steps:1
Check whether a refresh token was issued
The most common root cause is a missing Inspect the connection’s configured scopes. If
offline_access scope on the original authorization. Review the scope list in your connection credentials:BASH
offline_access (or the provider-equivalent) is absent, proceed to step 2.2
Update the scope list
Rerun
set-credentials with the corrected scope list, including offline_access:BASH
3
Re-authorize the connection
Updating the scope list alone is not sufficient, the provider issues a refresh token during the authorization flow. Each user who holds the connection must reauthorize it:
- From the main menu in the watsonx Orchestrate UI, go to Manage > Security > Connections
- Locate the affected connection and click the overflow menu icon and select Edit connection.
- Click Connect now.
- Complete the OAuth consent screen, ensuring the updated scopes are shown.
access_token and if offline_access was included, the refresh_token. Subsequent token renewals will happen silently.4
Verify the fix
Run a test invocation of the affected tool from the agent chat UI. If the call succeeds, the refresh token is in place. If it fails again, check that the OAuth app in the provider’s developer console has
offline_access enabled as an allowed scope.
