firebase-admin

How do I send Firebase token to backend (Node / Express) via HTTPS

强颜欢笑 提交于 2019-12-01 07:15:26
I have client-side login on my app which is working just fine. Now I need to pass the clients UID to Node. Found this Verify ID Tokens in Firebase docs, but i just don't know how would i actually do this part: "Send token to your backend via HTTPS" Does your Node server-side piece have an API already created, or do you need to build that? There are many ways to pass this information from the client to the server. Sometimes auth information is passed in an HTTP header of an API call that does something else. Sometimes APIs include a specific call to "register" a user with the backend, where you

How do I send Firebase token to backend (Node / Express) via HTTPS

痞子三分冷 提交于 2019-12-01 04:53:26
问题 I have client-side login on my app which is working just fine. Now I need to pass the clients UID to Node. Found this Verify ID Tokens in Firebase docs, but i just don't know how would i actually do this part: "Send token to your backend via HTTPS" 回答1: Does your Node server-side piece have an API already created, or do you need to build that? There are many ways to pass this information from the client to the server. Sometimes auth information is passed in an HTTP header of an API call that

How to properly exit firebase-admin nodejs script when all transaction is completed

亡梦爱人 提交于 2019-11-30 09:15:57
Is there anyway to check if all firebase transaction is completed in firebase-admin nodejs script, and properly disconnect from firebase and exit the nodejs script? Currently, the firebase-admin nodejs script will just keep running even after all the transaction has been completed. If you're keeping track of all the promises and they complete successfully, what's happening is that the app is keeping a connection open, you can kill the app, by using: app.delete() For example if you used the default app you can do this: firebase.app().delete() The DatabaseReference.transaction() method returns a

Firebase Admin SDK to Log user in from Server

心不动则不痛 提交于 2019-11-30 07:51:25
问题 I have been using Firebase Admin SDK in my Node JS code for authenticating users from the server side. The Admin SDK provides a method admin.auth().createUser() to create new users. admin.auth().createUser({ email, password, displayName: name }) .then(function(user) { console.log("Successfully created new user:", user.uid) return res.send(user) }) .catch(function(err) { console.log("Error creating new user:", err) return res.send(err) }) But now how to make a user login like there is a method

Firestore moving to timestamps in Firebase functions

ぐ巨炮叔叔 提交于 2019-11-30 07:07:56
Yesterday, all my firebase functions started throwing the following warning: The behavior for Date objects stored in Firestore is going to change AND YOUR APP MAY BREAK. To hide this warning and ensure your app does not break, you need to add the following code to your app before calling any other Cloud Firestore methods: const firestore = new Firestore(); const settings = {/* your settings... */ timestampsInSnapshots: true}; firestore.settings(settings); With this change, timestamps stored in Cloud Firestore will be read back as Firebase Timestamp objects instead of as system Date objects. So

How can I list all users using firebase admin sdk

拈花ヽ惹草 提交于 2019-11-29 14:17:53
Is there a way to list all the users using the firebase admin sdk? Documentation only shows getting one user either by uid or email. Update As @Webp says in their answer, there is now an API to list all users in the Admin SDK. Original answer: There is no public API to retrieve a list of users from the Firebase Admin SDK. The typical way to deal with this scenario is to keep a list of the pertinent user information in the Firebase Database. See this original question for more: How do I return a list of users if I use the Firebase simple username & password authentication The latest firebase

How to force logout firebase auth user from app remotely

我们两清 提交于 2019-11-29 12:45:56
问题 I have a project which uses firebase auth with firebaseUI to authenticate users. I have enabled Google, Facebook and email providers. What I need is to remotely logout or disable some of the users. I want the users to logout from the app on doing so. I tried disabling the user in the firebase console and also used the firebase admin SDK (https://firebase.google.com/docs/auth/admin/manage-sessions) to revoke the refresh tokens. I waited for more than 2 days and still noticed that the user was

Is there a way to send the verification email with the Firebase Admin SDK from my Node.js server?

时光怂恿深爱的人放手 提交于 2019-11-29 10:39:44
Is there a way to send the email verification email from my server ? This is how it's done on the client: authData.sendEmailVerification().then(function() { Is there a way to do it on the server ? firebaser here To my surprise there currently is no option to send verification email from within the Admin SDK. I'd recommend you file a feature request . What you can do from the Admin SDK is update a user profile to mark their email as verified . This allows you to take control of the entire verification flow if you want to, finishing with a call to admin.auth().updateUser(...) (on Node.js, see

How to verify users current password?

跟風遠走 提交于 2019-11-29 10:38:51
So, maybe I missed this somewhere in the docs but I couldn't find anything of the sort. I wan't my users to have to type in their current password to be able to create a new one. From what I understand if the user is authenticated he is able to update his password without providing his current one. Even if this might be somewhat secure I would rather have him type his old one to prevent people from going on already authenticated sessions from say family members or so and changing the pw. Is there any way to do this? (I have no problem using the Admin SDK since I already set up a server for

How many topics an app instance can subscribe in FCM?

喜欢而已 提交于 2019-11-29 08:24:28
As mentioned in FCM documents, unlimited topic can be created for one Firebase application. But as the Firebase Admin SDK document : explains an error: messaging/too-many-topics :- A registration token has been subscribed to the maximum number of topics and cannot be subscribed to any more. I was not able to find this threshold value of maximum number of topics. Can anybody explain, what is the limit? How many topics an app instance can subscribe to in FCM? I found the answer by running a subscription script for an app instance. After subscribing to 1999 topics, for the next subscription it