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

gar_auth

Authorize googleAuthR


Description

Wrapper of token_fetch

Usage

gar_auth(
  token = NULL,
  email = NULL,
  scopes = getOption("googleAuthR.scopes.selected"),
  app = gar_oauth_app(),
  cache = gargle::gargle_oauth_cache(),
  use_oob = gargle::gargle_oob_default(),
  package = "googleAuthR"
)

Arguments

token

an actual token object or the path to a valid token stored as an .rds file

email

An existing gargle cached email to authenticate with or TRUE to authenticate with the only email available.

scopes

Scope of the request

app

app as specified by gar_auth_configure

cache

Where to store authentication tokens

use_oob

Whther to use OOB browserless authetication

package

The name of the package authenticating

Value

an OAuth token object, specifically a Token2.0, invisibly

See Also

Examples

## Not run: 

# sets GCP project to auth through
gar_auth_configure(path="path/to/gcp-client.json")

# starts auth process with defaults
gar_auth()

# switching between auth scopes
# first time new scope manual auth, then auto if supplied email   
gar_auth(email = "your@email.com", 
         scopes = "https://www.googleapis.com/auth/drive")
         
# ... query Google Drive functions ...

gar_auth(email = "your@email.com", 
         scopes = "https://www.googleapis.com/auth/bigquery")
         
# ..query BigQuery functions ...


## End(Not run)

googleAuthR

Authenticate and Create Google APIs

v1.4.0
MIT + file LICENSE
Authors
Mark Edmondson [aut, cre] (<https://orcid.org/0000-0002-8434-3881>), Jennifer Bryan [ctb], Johann deBoer [ctb], Neal Richardson [ctb], David Kulp [ctb], Joe Cheng [ctb]
Initial release

We don't support your browser anymore

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