get_oauth_content_credentials {connectapi} | R Documentation |
Perform an OAuth credential exchange to obtain a content-specific OAuth access token.
Description
Perform an OAuth credential exchange to obtain a content-specific OAuth access token.
Usage
get_oauth_content_credentials(
connect,
content_session_token = NULL,
requested_token_type = NULL
)
Arguments
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: |
requested_token_type |
Optional. The requested token type. If unset,
will default to |
Details
Please see https://docs.posit.co/connect/user/oauth-integrations/#obtaining-a-service-account-oauth-access-token for more information.
Value
The OAuth credential exchange response.
Examples
## 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)