Skip to content

feat: check if running on Connect and grab user session token within get_oauth_credentials() #366

Closed as duplicate of#384
@dethmasque

Description

@dethmasque

When using connectapi to exchange the user session token for an OAuth access token the environment check and user session token acquisition occur outside of the connectapi package, ex:

  # check if running on Posit Connect
  if (Sys.getenv("RSTUDIO_PRODUCT") == "CONNECT") {
    # initialize Connect API client
    client <- connect()
    # read the user-session-token header
    user_session_token <- session$request$HTTP_POSIT_CONNECT_USER_SESSION_TOKEN
    # grab the OAuth Integration access token using the session token
    credentials <- get_oauth_credentials(client, user_session_token)
    token <- credentials$access_token

We should build this into connectapi.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions