googleCloudStorageR::gcs_auth:错误:非交互式会话且未选择身份验证电子邮件

发布于 2025-01-14 22:55:04 字数 1024 浏览 7 评论 0原文

我想在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文