get_oauth_content_credentials | R Documentation |
Perform an OAuth credential exchange to obtain a content-specific OAuth access token.
get_oauth_content_credentials(connect, content_session_token = NULL)
connect |
A Connect R6 object. |
content_session_token |
Optional. The content session token. This token
can only be obtained when the content is running on a Connect server. The
token identifies the service account integration previously configured by
the publisher on the Connect server. Defaults to the value from the
environment variable: |
Please see https://docs.posit.co/connect/user/oauth-integrations/#obtaining-a-service-account-oauth-access-token for more information.
The OAuth credential exchange response.
## Not run:
library(connectapi)
library(plumber)
client <- connect()
#* @get /do
function(req) {
credentials <- get_oauth_content_credentials(client)
# ... do something with `credentials$access_token` ...
"done"
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.