Created
April 27, 2021 12:36
-
-
Save btupper/e2ba7b6b3a63827265a4597d865db0fd to your computer and use it in GitHub Desktop.
Google tokens
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting and saving a token for accessing documents in Google Drive | |
# this takes you through an interactive session tp exchange passcodes | |
token <-gargle::token_fetch(scopes = c("email", "https://www.googleapis.com/auth/drive")) | |
# then save it for use in another session | |
saveRDS(x, "~/.httr-token.rds") | |
token <- googlesheets::gs_auth(token = token) | |
# or for later session use | |
# token <- googlesheets::gs_auth(token = readRDS("~/.httr-token.rds")) | |
# See for more... | |
# https://support.rstudio.com/hc/en-us/articles/217952868-Generating-OAuth-tokens-for-a-server-using-httr | |
# https://cran.r-project.org/web/packages/googlesheets/vignettes/managing-auth-tokens.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment