Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform 如何允许团队成员使用我的Google Cloud Speech to Text API帐户?_Google Cloud Platform_Google Iam_Google Cloud Iam - Fatal编程技术网

Google cloud platform 如何允许团队成员使用我的Google Cloud Speech to Text API帐户?

Google cloud platform 如何允许团队成员使用我的Google Cloud Speech to Text API帐户?,google-cloud-platform,google-iam,google-cloud-iam,Google Cloud Platform,Google Iam,Google Cloud Iam,我启用了GoogleCloudSpeech-to-Text API,但我想允许团队成员在我的帐户上使用它 我进入IAM添加了一个新用户,但我没有看到任何与云语音到文本API相关的角色。我需要选择什么IAM角色才能允许新团队成员访问API?文本到语音API是Google的一种特殊(旧)API,不需要角色。API URL也不需要项目定义。因此,您需要一个链接到该项目的帐户才能访问Speech to text API 为此,“服务帐户”帐户是要使用的帐户。因此,用户需要使用服务帐户来访问API。要防止

我启用了GoogleCloudSpeech-to-Text API,但我想允许团队成员在我的帐户上使用它


我进入IAM添加了一个新用户,但我没有看到任何与云语音到文本API相关的角色。我需要选择什么IAM角色才能允许新团队成员访问API?

文本到语音API是Google的一种特殊(旧)API,不需要角色。API URL也不需要项目定义。因此,您需要一个链接到该项目的帐户才能访问Speech to text API

为此,“服务帐户”帐户是要使用的帐户。因此,用户需要使用服务帐户来访问API。要防止服务帐户密钥文件生成(潜在安全问题的根源),请选择

使用gcloud cli,您可以代表服务帐户生成有效的访问令牌

gcloud auth print-access-token --impersonate-service-account=<the service account to impersonate>
gcloud auth打印访问令牌--模拟服务帐户=
因此,在您的API调用中,从您的计算机(我的意思是使用您自己的用户凭据)可以这样做

curl -d @inputdata -H "content-type: application/json" \
  -H "Authorization: Bearer $(gcloud auth print-access-token --impersonate-service-account=<the service account to impersonate>)" \
  https://speech.googleapis.com/v1/speech:recognize
curl-d@inputdata-H“内容类型:application/json”\
-H“Authorization:Bearer$(gcloud auth打印访问令牌--模拟服务帐户=)”\
https://speech.googleapis.com/v1/speech:recognize