Learn R Programming

rstudioapi (version 0.18.0)

getOAuthIntegrations: 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()

Arguments

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.

Examples

Run this code
if (FALSE) {
# 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)
}
}

Run the code above in your browser using DataLab