我正在使用gcp服务帐户,但在调用对话流api时却给出错误: [英] i am using gcp service account but when calling dialogue flow api its giving error :

查看:88
本文介绍了我正在使用gcp服务帐户,但在调用对话流api时却给出错误:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里有错误:


您的应用程序已使用
Google Cloud SDK或Google Cloud Shell中的最终用户凭据进行了身份验证
dialogflow.googleapis.com不支持这些功能。我们建议大多数服务器应用程序
改为使用服务帐户。有关服务
帐户以及如何在您的应用程序中使用它们的更多信息,请参见
https://cloud.google.com/docs/authentication/


推荐答案

许多客户端库从应用程序默认凭据中提取该链接提供了有关如何检查它们的摘要。本质上,它将检查环境变量的路径并从该位置提取凭证。此错误消息表示您使用的是用户帐户,而不是服务帐户。

Many of the Client Libraries pull from the Application Default Credentials, a summary of how they're checked is provided on that link. Essentially it will check environmental variables for a path and pull credentials from that location. This error message means you're using a User account, and not a service account.

通常情况下,您使用 gcloud auth登录,即使您提供了服务帐户,它仍然是从应用程序默认位置提取的。

Most commonly you logged in once using gcloud auth login, and even though you provided your service account it's still pulling from the Application Default location.

与您一样,关联特定服务帐户的方法为 gcloud auth activate-service-account --key-file< path>

As you did, the method to associate a specific service account is gcloud auth activate-service-account --key-file <path>

或者使用真实的应用程序默认值,您可以使用 gcloud auth应用程序-默认登录

Alternatively to use the true application default you can use gcloud auth application-default login

这篇关于我正在使用gcp服务帐户,但在调用对话流api时却给出错误:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆