Problems with authentication, help is welcome. Is this a bug ?

1 favourites
  • 9 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi guys, first of all I wanted to say I love construct 3.

    I've only started to work on it but I think it's a great product.

    I need to build a mobile game that uses firebase.

    If I use postman or go to any REST API testing site and POST the exact same string to firebase it responds correctly.

    Using construct 3 I get "Email Missing".

    I've added the preview.construct.net domain to firebase so that is not the issue.

    I would really appreciate some help here. It only takes 2 minutes to reproduce this.

    This is the event sheet. very simple just add an AJAX object, Json and text.

    If you use postman or go to reqbin.com you will get:

    Here is the text of what I'm sending using AJAX, in case you want to copy&past into Construct 3:

    URL "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=AIzaSyBPAFvzKk9vZjHcm_uYb3JBw8_70_rOLYk"

    Data "{""email"":""test@test.com"",""password"":""test123""}"

    Thanks in advance

  • Forgot to add what I get back as a I response if I use construct3

    where you can see the message, missing email. But the email is there and if I copy and paste the same data to postman I get a valid response.

    thanks in advance

  • I don't know why data is not sent, but sending the same values in url parameters seems to work:

    "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=AIzaSyBPAFvzKk9vZjHcm_uYb3JBw8_70_rOLYk&email=" & URLEncode("test@test.com") & "&password=test123"

  • Many thanks dop2000 !

    that is really weird. Why do you think this happens in Construct ?

    must be a bug right ?

    bummer

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I think I've seen this issue before. May be a bug, I don't know.

    You can report it here:

    github.com/Scirra/Construct-3-bugs/issues

  • Many thanks dop2000 !

    that is really weird. Why do you think this happens in Construct ?

    must be a bug right ?

    bummer

    Do I need to encode the "at" symbol in some way inside a string ??

  • In case this is helpful for others.

    I was about to file a bug but then decided to try one last thing, which was helped by what dop2000 wrote in his message.

    This works and I get the right response from firebase.

    Why sending a json doesn't and this does I don't understand...

    regards

  • You must URLEncode URL parameters for them to be sent correctly.

    You can't put a string like {email:example@example.com} in a URL, because it uses special characters which aren't allowed in URLs. If you URL encode it, you get %7Bemail%3Aexample%40example.com%7D (note no braces, colon or at sign, because none of that is allowed in URLs). This is why Construct provides a URLEncode expression. And it's also why it tells you that when you select the "Data" parameter!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)