Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting a bad request bad request 400 when creating user(Firebase)

I am developing a web app and I'm using Firebase for that. Since I do not have a domain name yet, I'm trying to use my localhost. I can see localhost in OAuth redirect domains. Also the initializing part is working fine.

But when I create a user using firebase.auth().signInWithEmailAndPassword it shows [HTTP/2.0 400 Bad Request 447ms] when posting to https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword.

I'm new to web app development and Firebase web as well. Somebody please help me to do this using my localhost.

Thank you

like image 869
Choxmi Avatar asked May 20 '16 12:05

Choxmi


People also ask

What is a 400 Bad Request error?

It’s called a 400 error because that’s the HTTP status code that the web server uses to describe that kind of error. A 400 Bad Request error can happen because there’s a simple error in the request. Perhaps you’ve mistyped a URL and the server can’t return a 404 Error, for some reason.

What is a bad request in http?

Bad Request. Your browser sent a request that this server could not understand. HTTP Error 400. The request hostname is invalid. 400 - Bad request. The request could not be understood by the server due to malformed syntax. The client should not repeat the request without modifications.

Why am I getting 404 and 400 errors on my website?

Perhaps you’ve mistyped a URL and the server can’t return a 404 Error, for some reason. Or maybe your web browser is trying to use an expired or invalid cookie. Some servers that are not configured properly can also throw 400 errors instead of more helpful errors in some situations.

How do I fix a 400 error on my computer?

Do this in Windows by executing ipconfig /flushdns from a Command Prompt window. This is not the same as clearing your browser's cache. Clear your browser's cache. A cached but corrupt copy of the web page you're trying to access could be the root of the problem that's displaying the 400 error.


1 Answers

You can create a user using firebase.auth().createUserWithEmailAndPassword(email, password). The email must be in a valid format. Don't forget that the password must be strong enough. Firebase returns auth/weak-password error code when using a weak password (less than 6 chars).

See also: https://firebase.google.com/docs/reference/js/firebase.auth.Auth#createUserWithEmailAndPassword

like image 141
TADOKORO Saneyuki Avatar answered Sep 30 '22 14:09

TADOKORO Saneyuki