Firebase Auth On The Server With Node.JS / Express

2,129 views
Skip to first unread message

Ian Cervantez

unread,
Jun 9, 2016, 9:12:06 PM6/9/16
to Firebase Google Group
I'm getting the following error:

TypeError: _firebase2.default.auth(...).signInWithEmailAndPassword is not a function

I checked the `firebase.auth()` object and saw only two functions:
  • createCustomToken
  • verifyIdToken
So I am guessing that when I did an npm install for the Firebase SDK, it gave me a limited version "optimized for servers".  Thing is, I want to have the full functionality.  I thought the SDK was the same for the client and the server - how do I get access to the missing functions?

Jacob Wenger

unread,
Jun 10, 2016, 12:45:04 AM6/10/16
to fireba...@googlegroups.com
This has already been discussed on many threads in this Google Group. See this answer from me for the latest.

Cheers,
Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/5356b72f-fc9f-490c-b9a9-15aaab067ec9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PBK101

unread,
Nov 2, 2016, 6:59:26 PM11/2/16
to Firebase Google Group
Jacob,

I looked at the post and to me it seems only to cover te use of service accounts.

But if I want to authenticate using a given email and password how do that from the server side ? 

The scenario we have is that we support both a username and an email as an identifier ffor the account so we cannot obtain the token client side.

PBK

Jacob Wenger

unread,
Nov 3, 2016, 3:19:37 PM11/3/16
to fireba...@googlegroups.com
Hey PBK,

If you initialize the Node.js SDK with an API key instead of a service account, you can use the normal client-side auth methods like authWithEmailAndPassword(). All of the methods documented here should work for you in Node.js

Cheers,
Jacob

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages