Retrieve OAuth credentials for a configured OAuth integration in Posit Workbench. This function exchanges the current session for OAuth credentials that can be used to authenticate with external services. This works in any IDE running within a Posit Workbench session.
getOAuthCredentials(audience)A list containing:
The OAuth access token.
The token expiry time as a POSIXct datetime object.
The integration GUID (audience) that was used to retrieve the credentials.
Throws an error if the credentials cannot be retrieved or the integration is not found.
This function requires Posit Workbench version 2026.01.0 or later. It works in any IDE running within a Posit Workbench session (not just RStudio).