Skip to content

Conversation

@atheriel
Copy link
Contributor

@atheriel atheriel commented Jan 13, 2026

This commit introduces getIdentityToken(), which fetches the OpenID Connect identity token for the current user from Posit Workbench via RPC, if possible.

This function is intended to help downstream packages implement identity federation (e.g. in rsconnect and pak).

It also updates assertWorkbenchSession() to issue more generic error messages since it now covers both broader functionality.

Unit tests are included.

Part of https://github.com/posit-dev/connect/issues/28149.

This commit introduces `getIdentityToken()`, which fetches the OpenID
Connect identity token for the current user from Posit Workbench via
RPC, if possible.

It also updates `assertWorkbenchSession()` to issue more generic error
messages since it now covers both broader functionality.

Unit tests are included.

Signed-off-by: Aaron Jacobs <aaron.jacobs@posit.co>
Copy link
Contributor

@zachhannum zachhannum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm this works for me in my dev environment.

Not sure if you want this showing up in rstudio.github.io/rstudioapi, but if you do you'll want to add it here I think:

rstudioapi/_pkgdown.yml

Lines 85 to 92 in 788cf65

- title : OAuth & Authentication
desc : Work with OAuth integrations and authentication in Posit Workbench.
contents :
- getOAuthIntegrations
- getOAuthIntegration
- findOAuthIntegration
- getOAuthCredentials
- getDelegatedAzureToken

(this also just made me realize the azure func is missing there)

Copy link
Contributor

@kevinushey kevinushey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kevinushey kevinushey merged commit 8755ca1 into main Jan 13, 2026
7 checks passed
@kevinushey kevinushey deleted the aj-identity-token branch January 13, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants