Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/286.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
Python 吊销firebase管理员凭据证书_Python_Firebase_Google Cloud Platform_Service Accounts_Google Cloud Iam - Fatal编程技术网

Python 吊销firebase管理员凭据证书

Python 吊销firebase管理员凭据证书,python,firebase,google-cloud-platform,service-accounts,google-cloud-iam,Python,Firebase,Google Cloud Platform,Service Accounts,Google Cloud Iam,在服务器上,使用python访问firestore管理员: import firebase_admin from firebase_admin import credentials, firestore cred = credentials.Certificate('myfile.json') myfile.json已经添加到git回购中,所以现在我想知道是否有办法撤销它并创建一个新的 在firebase教程之后,它应该是一个服务帐户,但是google云上没有可撤销的旧服务帐户 myfile.

在服务器上,使用python访问firestore管理员:

import firebase_admin
from firebase_admin import credentials, firestore
cred = credentials.Certificate('myfile.json')
myfile.json已经添加到git回购中,所以现在我想知道是否有办法撤销它并创建一个新的

在firebase教程之后,它应该是一个服务帐户,但是google云上没有可撤销的旧服务帐户

myfile.json是几个月前创建的,因此没有办法知道它是如何创建的(就像使用firebase/google cloud做任何事情时,你必须跳转到各地的多个指南,突然知道各种事情才能取得任何进展)

编辑:
我没有找到该服务帐户的原因是,谷歌云选择了一个与firebase项目名称相似的项目。

如果你查看
myfile.json
的内容,请注意三个字段:
project\u id
客户端电子邮件
私钥\u id

这些字段告诉您在其中创建凭据的项目ID、服务帐户的名称(客户端\电子邮件)和密钥ID

有了这些信息,你可以进入谷歌云控制台。登录并选择您的项目(如果您管理多个项目)。转到IAM->Service Accounts并通过
客户端电子邮件
查找Service Accounts。然后禁用或删除服务帐户


您可以执行更高级的操作,例如禁用一个密钥并创建另一个密钥(密钥轮换),但由于服务帐户密钥JSON文件已泄漏,我将删除该服务帐户并创建一个新的。

然后要创建一个新文件,您可以从firebase而不是google云控制台执行此操作。在设置->服务帐户中,您可以创建一个服务帐户,由于某种原因(截至目前为止)“生成新私钥”实际上意味着下载新的myfile。json@RobinManoli-除非下载新的JSON密钥文件,否则您希望如何获取该文件?我希望“生成”生成密钥。无需下载.json文件即可生成密钥。动词应该是“生成并下载”。