Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

oauth_service_token

Generate OAuth token for service accounts.


Description

Service accounts provide a way of using OAuth2 without user intervention. They instead assume that the server has access to a private key used to sign requests. The OAuth app is not needed for service accounts: that information is embedded in the account itself.

Usage

oauth_service_token(endpoint, secrets, scope = NULL, sub = NULL)

Arguments

endpoint

An OAuth endpoint, created by oauth_endpoint()

secrets

Secrets loaded from JSON file, downloaded from console.

scope

a character vector of scopes to request.

sub

The email address of the user for which the application is requesting delegated access.

See Also

Examples

## Not run: 
endpoint <- oauth_endpoints("google")
secrets <- jsonlite::fromJSON("~/Desktop/httrtest-45693cbfac92.json")
scope <- "https://www.googleapis.com/auth/bigquery.readonly"

token <- oauth_service_token(endpoint, secrets, scope)

## End(Not run)

httr

Tools for Working with URLs and HTTP

v1.4.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.