googleCloudStorageR::gcs_auth:错误:非交互式会话且未选择身份验证电子邮件
我想在 docker 中使用此功能来验证 Biq Query 和 Google Cloud Storage。
authenticate <- function() {
scopes <- c("https://www.googleapis.com/auth/cloud-platform",
'https://www.googleapis.com/auth/spreadsheets',
'https://www.googleapis.com/auth/drive')
token <- gargle::token_fetch(scopes = scopes)
bigrquery::bq_auth(token = token)
googleCloudStorageR::gcs_auth(token = token, token)
}
我将我的凭据从 ~/.config/gcloud/application_default_credentials.json
附加到 docker。 bq_auth
工作正常。如果我在 docker 之外运行该函数,它可以正常工作,但我必须交互式登录。
使用 docker,我会收到错误
Error: Non-interactive session and no authentication email selected.
Setup JSON service email auth or specify email in gar_auth(email='[email protected]')
即使我将电子邮件传递给 gcs_auth
,它也不起作用(但是我想避免这种情况)。
I'd like to use this function in docker to authenticate Biq Query and Google Cloud Storage.
authenticate <- function() {
scopes <- c("https://www.googleapis.com/auth/cloud-platform",
'https://www.googleapis.com/auth/spreadsheets',
'https://www.googleapis.com/auth/drive')
token <- gargle::token_fetch(scopes = scopes)
bigrquery::bq_auth(token = token)
googleCloudStorageR::gcs_auth(token = token, token)
}
I append my credentials to docker from ~/.config/gcloud/application_default_credentials.json
. bq_auth
works fine. If I run the function outside the docker, it works fine but I have to interactively sign in.
With docker, I get an error
Error: Non-interactive session and no authentication email selected.
Setup JSON service email auth or specify email in gar_auth(email='[email protected]')
Even if I passed my email to gcs_auth
, it didn't work (but I'd like to avoid that).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论