Its possible to enable sign-in methods (like email and password, for example) in a firebase project with no use the console interface? 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. Is it possible to be made with gcloud cli or API request?
1 Answers
A general-purpose mechanism for answering this type of question is to use a combination of:
- Chrome's Developer Tools to monitor network calls while you make changes in the Console;
- Google's APIs Explorer to interpret REST calls.
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.
E.g. Adding uses 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.
So, you'll need to try to repro PATCHing the API using that updateMask, your own API key, the body (Config) and some variant of those request headers.
- 32,823
- 5
- 47
- 88