Firebase plugin return "INVALID_REQUEST_URI" when using "loginWithSocial"

Hi,
 
    I have encountered the problem when using “loginWithSocial” function.
    Here is what I inputted to “loginWithSocial”:
 

firebase.loginWithSocial(accessToken, "facebook.com", "https://xxx.firebaseapp.com/\_\_/auth/handler", listener)

    where “https://xxx.firebaseapp.com/__/auth/handler” is the link copied from firebase
 
 
    And it returns the following:
 

{"isError":true,"error":"request failed: {\n \"error\": {\n \"errors\": [\n {\n \"domain\": \"global\",\n \"reason\": \"invalid\",\n \"message\": \"INVALID\_REQUEST\_URI\"\n }\n],\n \"code\": 400,\n \"message\": \"INVALID\_REQUEST\_URI\"\n }\n}\n"}

    I’ve already set the link in facebook app setting “Valid OAuth redirect URIs”.

    Is there anything missing in settings or in code?

   Thanks for your help

Is your firebase console setup up to handle facebook auth?

Yes, already set

Can you please post a sample app that clearly reproduces this issue.

Here is the sample app

Please replace the credentials in the following place:

  1. build.setting:

    facebook app ID (Actually it is not necessary, in case you need to use the “login with facebook” code)

    Note: 3 places to set facebook app ID

  1. main.lua:

    fbToken: Please replace your facebook token

    Note: I leave the facebook login code here in case you need it

  1. ProjectObject/FirebaseHandler:

    FIREBASE_MYURL: the “myUrl” of the plugin

    FIREBASE_DATABASE_SECRET: the “databaseSecret”

    FIREBASE_MYKEY: the “myKey”

    FIREBASE_AUTH_LINK: Link from firebase facebook setting

One more comment for the plugin:

Please update the document if you can, since the input parameter of “loginWithSocial” in your document is missing “request_uri”

Thanks a lot!

BTW, when I call the function for testing:

firebase.uploadData(“test/test”, {data=100},lis)

it returns the following:

2017-05-11 14:19:53.884 Corona Simulator[259:7430] ERROR: network: network request failed: /test/test/.json?auth= [-1002: unsupported URL]

is it correct?

try firebase.uploadData(“test”, {data=100},lis)

actually I tried and it returns:

2017-05-11 14:28:55.898 Corona Simulator[259:7430] ERROR: network: network request failed: /test/.json?auth= [-1002: unsupported URL]

so i tried “test/test” to see if I can get any clue

have you tried using the demo app? 

https://github.com/scottrules44/firebase-demo

tried with email and password authentication enabled, and when I create account, it returns “request failed”

I found that the “database secret” will affect the process of creating email member.

I can create a new member when I do not enter the database secret to module

I am working on implementing new firebase auth tokens since database secrets are deprecated. I will work on it when I can but I am very busy the last few day at my school.  

Hi,

Scott

I’m using the demo to test the functionality :

Not working Error: 

firebase.myUrl = "https://xxxx-40d73.firebaseio.com/"

firebase.myKey = “XXXXXyNLtCno:SSSSSS1bFMaw8VOTrkPvViWXXXXX-yKb6T63I4hCZh9KpF1EfZ44XXXXXSDmqlOKlTvcdq7zjZSaJXXXX-3ESi02Eoh_h8UJ9bmxgdOjnHrCVuBr_9XXXXXXX”

firebase.databaseSecret = “XXXXXWXN9rBaeWXXXXXNfu11fj3yesKSQKXXXXX”

request failed: {

 “error”: {

  “errors”: [

   {

    “domain”: “usageLimits”,

    “reason”: “keyInvalid”,

    “message”: “Bad Request”

   }

  ],

  “code”: 400,

  “message”: “Bad Request”

 }

}

Thanks.

rmoscat

I just wanted to make a statement on the commutiy plugin on the marketplace. It has been disabled, I am not sure what the future of this plugin is at the moment. I am pretty busy right now to make a quick fix. There does not seem to be a quick fix for this plugin. Since it is disabled that means new people can not use it. 

Here is the source code if you want to try to use it.

https://github.com/scottrules44/firebase-plugin-source