Available Credentials

Enhanced Advanced

The Available Credentials view

The Available Credentials view is part of the Posit Workbench extension sidebar. It displays custom OAuth integrations that your administrator configured and lets you manage authentication directly from the IDE.

To open the view, click the Posit Workbench Extension tab in the Activity Bar.

Available Credentials view in the Posit Workbench sidebar

The Available Credentials view displays custom OAuth integrations and their authentication status.

Each integration in the tree shows its current authentication status:

Status Icon Description
Authenticated You have signed in to this integration and it is ready to use. The description shows the Integration ID.
Not signed in The integration requires authentication before use.
Configuration error The integration has a configuration problem. Point to the integration to see error details in the tooltip.
Note

The Available Credentials view automatically refreshes every 30 seconds when visible, and pauses when you hide the view to reduce resource usage. To manually refresh, click the Refresh button in the view toolbar.

Signing in

  1. In the Available Credentials view, locate the integration you want to authenticate with.
  2. Click the Sign In button next to the integration, or right-click and select Sign In.

Sign In button on an unauthenticated credential

Click Sign In next to an unauthenticated integration to begin the OAuth flow.

A browser window opens to complete the OAuth authorization flow with the provider. After successful authentication, the integration status updates to show the key icon.

Signing out

  1. Right-click an authenticated integration.
  2. Select Sign Out.

Sign Out option in the context menu

Right-click an authenticated integration and select Sign Out.

The integration status updates to show the lock icon, indicating you are no longer signed in.

Viewing integration details

Expand any integration in the tree to view its configuration details:

Expanded integration showing details like Integration ID, Issuer, Client ID, Scopes, and URLs

Expand an integration to view its details directly in the tree.

The view shows the following details:

  • Integration ID (Globally Unique Identifier (GUID)): the unique identifier needed for programmatic access
  • Issuer: the OAuth provider URL
  • Client ID: the OAuth client identifier
  • Scopes: the permissions granted to this integration
  • Auth URL: the OAuth authorization endpoint
  • Token URL: the OAuth token endpoint

To copy any detail value, point to it and click the Copy Value icon that appears on the right.

Generating code snippets

The Available Credentials view can generate ready-to-use Python or R code for retrieving OAuth credentials. This is a quick way to get started with the posit-sdk (Python) or rstudioapi (R) packages.

Copying a snippet

  1. Right-click an authenticated integration.
  2. Select Copy Python Snippet or Copy R Snippet.

The snippet is copied to your clipboard, ready to paste into your editor.

Viewing a snippet

  1. Right-click an authenticated integration.
  2. Select View Python Snippet or View R Snippet.

A read-only editor tab opens with the generated code, with syntax highlighting. From there you can review the code before copying it.

Snippet viewer showing generated Python code

View a snippet in a read-only editor tab with syntax highlighting.

The callouts in the image above correspond to the following actions in the snippet view:

  1. Run the snippet in the active console by clicking the Run in Console icon in the editor toolbar.
  2. Copy the snippet code by clicking the Copy to Clipboard icon in the editor toolbar.
  3. Run the snippet in the active console by clicking the Run in Console code lens above the first line of code.
  4. Copy the snippet code by clicking the Copy to Clipboard code lens above the first line of code.

Running a snippet

  1. Right-click an authenticated integration.
  2. Select Run Python Snippet or Run R Snippet.

The snippet executes directly in the active console, so you can immediately inspect the returned credentials.

Generated snippet examples

The generated snippets use the integration’s GUID to retrieve credentials:

from posit.workbench import Client

client = Client()
credentials = client.oauth.get_credentials(audience="{integration_id}")

if credentials:
    access_token = credentials["access_token"]
    # Use access_token with your API requests
credentials <- rstudioapi::getOAuthCredentials(audience = "{integration_id}")

if (!is.null(credentials)) {
  access_token <- credentials$access_token
  # Use access_token with your API requests
}

For more details on using these SDKs, including token refresh, error handling, and finding integrations programmatically, see Custom OAuth Integrations: Using credentials in sessions.

Command palette commands

The following commands are available from the command palette (Ctrl+Shift+P / Cmd+Shift+P) under the Posit Workbench category:

Command Description
Refresh Available Credentials Manually refresh the credentials list.
View Credential Code Snippet Open a read-only editor tab with the generated code snippet for the selected integration.
Copy Credential Code Snippet Copy the generated code snippet for the selected integration to the clipboard.
Run Credential Code Snippet in Console Run the generated code snippet for the selected integration in the active console.
Back to top