Answer the question
In order to leave comments, you need to log in
How to log out using firebase REST API?
Good afternoon. I am doing a simple user authentication using the Firebase REST API following this guide:
https://firebase.google.com/docs/reference/rest/auth
Sign In:
await fetch(
'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=AIzaSyAgTJyexl3AhXyoRfnB6LSyv0ZBoaP3Nm8',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: values.username,
password: values.password,
returnSecureToken: true,
}),
},
)
.then((response) => response.json())
.then((response) => console.log(response));
await fetch(
'https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=AIzaSyAgTJyexl3AhXyoRfnB6LSyv0ZBoaP3Nm8',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: values.username,
password: values.password,
returnSecureToken: true,
}),
},
)
.then((response) => response.json())
.then((response) => console.log(response));
Answer the question
In order to leave comments, you need to log in
curl 'https://identitytoolkit.googleapis.com/v1/accounts:update?key=[API_KEY]' \
-H 'Content-Type: application/json' \
--data-binary '{"idToken":"[FIREBASE_ID_TOKEN]","deleteProvider":["[facebook.com]"]}'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question