[英]Enable sign-in methods in firebase project from API or gcloud
Its possible to enable sign-in methods (like email and password, for example) in a firebase project with no use the console interface?是否可以在不使用控制台界面的情况下在 firebase 项目中启用登录方法(例如 email 和密码)? I tried use a PATCH request to https://identitytoolkit.googleapis.com/admin/v2/projects/{project-id}/config?updateMask=signIn.email.enabled,signIn.email.passwordRequired , without success.
我尝试对https://identitytoolkit.googleapis.com/admin/v2/projects/{project-id}/config?updateMask=signIn.email.enabled,signIn.email.passwordRequired使用 PATCH 请求,但没有成功。 Is it possible to be made with gcloud cli or API request?
是否可以使用 gcloud cli 或 API 请求进行?
A general-purpose mechanism for answering this type of question is to use a combination of:回答此类问题的通用机制是使用以下组合:
I was intrigued by your question and tried this on my own project.我对你的问题很感兴趣,并在我自己的项目中尝试了这个。
By adding, enabling and then deleting the Email provider in the Firebase Console, I was able to grab the underlying REST API calls against identitytoolkit.googleapis.com
.通过在 Firebase 控制台中添加、启用然后删除 Email 提供程序,我能够获取针对
identitytoolkit.googleapis.com
的底层 REST API 调用。
Eg Adding uses projects.updateConfig :例如添加使用projects.updateConfig :
/admin/v2/projects/${PROJECT}/config?updateMask=signIn.email.enabled,signIn.email.passwordRequired&alt=json&key=${API_KEY}
And a request body:和一个请求体:
{
"signIn": {
"email": {
"enabled": true,
"passwordRequired": true
}
}
}
There are various request headers you may want to check, including:您可能需要检查各种请求标头,包括:
authorization: SAPISIDHASH {VALUE}
I've not seen SAPISIDHASH
before but others have, see this answer.我以前没见过
SAPISIDHASH
但其他人见过,请参阅此答案。
So, you'll need to try to repro PATCH
ing the API using that updateMask
, your own API key, the body ( Config
) and some variant of those request headers.因此,您需要尝试使用该
updateMask
、您自己的PATCH
密钥、正文 ( Config
) 和这些请求标头的一些变体来重现 API 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.