Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get pyrebase authentication error 400: bad request for url:https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=AIzaSyBBkunvEMcyeoGyDNo3bCCIDUFJR2377-w #424

Open
sid00100 opened this issue Aug 10, 2022 · 1 comment

Comments

@sid00100
Copy link

Make sure these boxes are checked before submitting your issue:

[x] Check that your version of Python is 3.4+
[x] Check that you are on the newest version of Pyrebase
[x] Check that Email/password provider is enabled in your Firebase dashboard under Auth -> Sign In Method.

Please don't be discouraged if you do not get a response to your issue quickly,
I maintain Pyrebase for fun and don't always have as much free time as I'd like.

Thank you for helping make Pyrebase better!

below is my route code

@app.route("/signup")
def signup():
    form = Sign_up()
    username = form.username.data
    email = form.email.data
    password = form.password.data

    user = auth.create_user_with_email_and_password(email, password)
    return render_template("signup.html", form=form)

below is the exact error that i am receiving

HTTPError
requests.exceptions.HTTPError: [Errno 400 Client Error: Bad Request for url: https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=AIzaSyBBkunvEMcyeoGyDNo3bCCIDUFJR2377-w] {
  "error": {
    "code": 400,
    "message": "ADMIN_ONLY_OPERATION",
    "errors": [
      {
        "message": "ADMIN_ONLY_OPERATION",
        "domain": "global",
        "reason": "invalid"
      }
    ]
  }
}

@sid00100 sid00100 changed the title I get pyrebase authentication gives error 400: bad request for url:https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=AIzaSyBBkunvEMcyeoGyDNo3bCCIDUFJR2377-w I get pyrebase authentication error 400: bad request for url:https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=AIzaSyBBkunvEMcyeoGyDNo3bCCIDUFJR2377-w Aug 10, 2022
@AsifArmanRahman
Copy link

Hi there, I believe the usage of the form is incorrect and you are sending invalid data to auth.create_user_with_email_and_password() method. Try the following code to check the data you're sending into this method, which will print the data in the terminal.

@app.route("/signup")
def signup():
    form = Sign_up()
    username = form.username.data
    email = form.email.data
    password = form.password.data

    # prints data
    print(f"email: {email}, password: {password}")

    user = auth.create_user_with_email_and_password(email, password)
    return render_template("signup.html", form=form)


If you find it helpful, please consider using firebase-rest-api available in PyPI, which I recently started maintaining and adding new features as pyrebase isn't maintained anymore.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants