Using Firebase Authentication with Cordova

832 views
Skip to first unread message

Hammad Tariq

unread,
Jan 4, 2017, 2:24:12 PM1/4/17
to Firebase Google Group
Hi,

I am trying to use Firebase JavaScript SDK Google Authentication with Cordova. I am getting the error [ERR] Script error. [unknown: 0] when I try to invoke signInWithRedirect. From this reply on another thread I understand using signInWithRedirect is currently not possible with Cordova (probably due to Cordova serves it through file://), however, that is an old reply, is there any new information on that?

Alternatively, I have also tried using the REST API user auth, couldn't get it to work, I understand there are methods to do that through Java and NodeJS but how one can do that with JavaScript? I have been searching extensively, there was a way of using old "Database secret", that didn't work with auth parameter, also tried using the method listed on this stackoverflow question, that didn't work and I also don't think it's a proper way of getting an access token.

I am working on an example tutorial about using Firebase for an IoT use-case, adding additional plugins is not ideal in my case. So far, I have only succeeded in using REST API with "public" database read and write rules.

I will highly appreciate any help in this regard.

Bassam

unread,
Jan 4, 2017, 4:51:09 PM1/4/17
to Firebase Google Group
Hey Hammad,
Regarding Firebase Auth with Cordova, it's in the works. We apologize for the delay. It's one of the Auth team's top priorities right now. In the meantime, you can use the suggested fallback where you use a Cordova plugin to sign in to the OAuth provider (Google or Facebook) and then use the retrieved OAuth credential (access token) to signInWithCredential.

Bassam

Guilherme Dellagustin

unread,
Apr 27, 2017, 8:09:45 PM4/27/17
to Firebase Google Group
Hi Bassam,

any news on this improvement you mentioned before?
I'm also interested.

BR,
Guilherme.

Bassam

unread,
May 3, 2017, 1:34:15 AM5/3/17
to Firebase Google Group
Hey Guilherme, you can now use signInWithRedirect with JS 3.9.0. Please refer to: https://firebase.google.com/docs/auth/web/cordova

Darren Croft

unread,
May 23, 2017, 6:52:15 PM5/23/17
to Firebase Google Group
That's good news. Is this usable somehow from firebaseUI in addition to the bare SDK describe on that page?

Thanks,
Darren

Bassam

unread,
May 24, 2017, 12:16:09 AM5/24/17
to Firebase Google Group
This is not yet usable from FirebaseUI-web.

Bassam
Reply all
Reply to author
Forward
0 new messages