简体   繁体   English

Gcloud:使用服务帐户进行身份验证

[英]Gcloud : Authenticating with Service Account

Authenticating with service account using gcloud We are using below command for activating service account using .json file. 使用gcloud使用服务帐户进行身份验证我们正在使用以下命令使用.json文件激活服务帐户。

gcloud auth activate-service-account <service_account> --key-file <file_name>

After doing this we are able to deploy templates. 完成此操作后,我们便可以部署模板。 But we are not supposed to keep json file on server for authentication purpose. 但是我们不应该将json文件保留在服务器上以进行身份​​验证。

Is there any other way of authenticating for deploying templates? 还有其他验证模板的方法吗?

Is there any way to deploy templates using client secret and client id without using json file ? 有什么方法可以使用客户端密钥和客户端ID而不使用json文件来部署模板?

To authorize Cloud SDK tools without storing private key, alternatively use tokens, see OAuth : 要在不存储私钥的情况下授权Cloud SDK工具,或者使用令牌, 请参阅OAuth

  1. gcloud init on your local terminal, see Run gcloud init documentation 您本地终端上的gcloud init请参阅运行gcloud init文档
  2. gcloud init on Compute Engine VM Instance, see Set up gcloud compute documentation 在Compute Engine虚拟机实例上执行gcloud init请参阅设置gcloud计算文档

To avoid prompts, provide parameters for gcloud init in the command line (works only when $ gcloud config set disable_prompts false ) 为避免出现提示,请在命令行中为gcloud init提供参数(仅在$ gcloud config set disable_prompts false

$ gcloud init --account=[account-name] --configuration=[config-name] --project=[prj-name] --console-only

For more details see documentation Managing SDK Configurations and Managing SDK Properties 有关更多详细信息,请参阅文档“ 管理SDK配置”和“ 管理SDK属性”。

There is also Google Cloud Shell, with 5GB of persistent disk storage and no additional authorization required to use Cloud SDK, see Starting Cloud Shell 还有Google Cloud Shell,具有5GB的永久磁盘存储空间,不需要其他授权即可使用Cloud SDK, 请参阅启动Cloud Shell

To provide authorization you also can use Cloud Identity and Access Management API . 要提供授权,您还可以使用Cloud Identity and Access Management API You may also find helpful the answer for similar question on Stack Overflow 您可能还会发现关于堆栈溢出类似问题答案很有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 验证服务帐户并执行简单查询 - Authenticating the Service Account and Performing a Simple Query 在没有服务帐户的情况下使用谷歌云 sdk 进行身份验证 - Authenticating with google cloud sdk without service account 使用服务帐户密钥验证Google相册API? - Authenticating Google Photos API with Service Account Key? 将Google Cloud功能验证为其他Google API上的服务帐户 - Authenticating a Google Cloud Function as a service account on other Google APIs 使用Fog-google中的服务帐户(电子邮件和密钥)进行身份验证 - Authenticating with service account (email & key) in fog-google 错误:(gcloud.auth.activate-service-account)无法激活给定的服务帐户。 请确保提供的密钥文件有效 - ERROR: (gcloud.auth.activate-service-account) Failed to activate the given service account. Please ensure provided key file is valid 验证Web服务 - Authenticating a Web Service 验证ProtoRPC服务 - authenticating to a ProtoRPC service 对WCF服务进行身份验证 - Authenticating to a WCF service 使用Java / Groovy中的Rest服务进行身份验证 - Authenticating with Rest Service in Java/Groovy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM