googleAuthR
是一个R包,用于包装google API客户端库(API的身份验证和进一步使用)。googlesheets
R包用于与Google表格API(即Google表格API的包装器)集成。
这些软件包中的每个软件包都有各自的OAuth2.0进程。我正在使用googleAuthR
登录到一个闪亮的应用程序,该应用程序进而也使用了googlesheets
库(但具有不同的身份验证过程)。
问题:我们如何设置googlesheets
包也使用初始googleAuthR
凭据?
这是我正在使用的过程(在闪亮的应用程序内:)>
对于我正在使用的googleAuthR
登录名:
options(googleAuthR.webapp.client_secret = "***REMOVED_FROM_EXAMPLE***") options(googleAuthR.webapp.client_id = "***REMOVED_FROM_EXAMPLE***") options(googleAuthR.scopes.selected = c("https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/spreadsheets"))
[对于
googlesheets
软件包,我目前正在使用预先注册的(单独的)令牌,该令牌已按照该软件包的插图中的说明保存到RDS文件中:
suppressMessages(gs_auth(token = "googlesheets_token.rds", verbose = FALSE)) gsheet_log <- googlesheets::gs_url("https://docs.google.com/spreadsheets/d/***REMOVED_FROM_EXAMPLE***/edit#gid=0")
我想用用
gs_auth
生成的令牌代替googleAuthR
的使用的流程。
[googleAuthR是一个R包,它包装了google API客户端库(API的身份验证和进一步使用)。 googlesheets R软件包用于与googlesheets API集成(即...
您可以尝试使用服务帐户令牌代替身份验证吗? https://gargle.r-lib.org/articles/get-api-credentials.html