getOAuthIntegrations: Get OAuth Integrations

View source: R/auth.R

getOAuthIntegrationsR Documentation

Get OAuth Integrations

Description

Retrieve a list of all OAuth integrations configured in Posit Workbench. This returns metadata about each integration including its authentication status, scopes, and configuration details.

Usage

getOAuthIntegrations()

Value

A list of OAuth integrations, where each element contains:

type

The integration type (e.g., "custom").

name

The integration name.

display_name

The display name (may be NULL).

client_id

The OAuth client ID.

auth_url

The authorization URL.

token_url

The token URL.

scopes

A character vector of OAuth scopes.

issuer

The OAuth issuer URL.

authenticated

Boolean indicating if currently authenticated.

guid

The globally unique identifier for this integration (useful for getOAuthCredentials()).

Returns an empty list if no integrations are configured.

Note

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).

Examples

## Not run: 
# Get all OAuth integrations
integrations <- getOAuthIntegrations()

# Show all integrations
for (int in integrations) {
  cat(sprintf("%s (%s): %s\n",
              int$name,
              int$guid,
              if (int$authenticated) "authenticated" else "not authenticated"))
}

# Filter to authenticated integrations only
authenticated <- Filter(function(x) x$authenticated, integrations)

# Get credentials for the first authenticated integration
if (length(authenticated) > 0) {
  creds <- getOAuthCredentials(audience = authenticated[[1]]$guid)
}

## End(Not run)

rstudioapi documentation built on Jan. 16, 2026, 5:18 p.m.