How to Retrieving Firebase User Accounts Without Forge

By | August 12, 2015

728x90-popads_1

I decided to make a sample using jq to pretty print the output files. That script is at the bottom of this post. I also added an automatic date/timestamp to the output files.

While migrating from Firebase┬áto another database┬áthe biggest issue is with navigating through the registered users in the Forge. Right now, the Forge has very limited user administration features. You basically get a list of users with the “Previous” and “Next” button. Have 25K users? Have fun paging through them.

skitch

 

WARNING : Be incredibly careful when viewing the registered users list. One click of the “Delete” button and, “Bye Bye User!” – no confirmation or anything. Ouch!

I know the Firebase team is working on some added functionality for this section. It’d be great if you could filter on an email address. Having a “First” and “Last” page would be really nice too. In fact, being able to manually tell it to give me Page 40 would be great so you can skip through a bit more easily.

Unfortunately, I don’t know when some improvements might be coming. So, I threw together my own process for quickly collecting my user info.

First, open the “Network” log in the your browser’s developer console and then go to your Firebase’s Forge. You’ll see a bunch of network calls. You’re looking for the one that has a token in the URL. Copy the token because you’re about to need it.

FYI : You cannot use your own custom generated token here. You have to use the one the Forge gets from the Firebase service. It’d be nice if Firebase let us use our own admin tokens here.

skitch-1

 

Now, you’ve got everything you need to get your shell fu on and get all your user account info in one simple step.

Here is a bash script to download your users.

Simply call the script like this:

./collect-firebase-user-accounts.sh my-fb-users my-awesome-fb-app dkdl3l-some-crazy-token-here-asdlkl

Now, all of your Firebase user accounts will be output to .json files in the same directory you ran this script from.

There are all kinds of ways to customize this. You might want to:

  • Output to a different directory
  • Use something like ./jq to pretty print the account details.

It would be nice if Firebase allowed the &print=pretty option on the URL, but they don’t; so, roll your own pretty print if you feel the need.

For me, just having a nice safe download of these makes me happy. If I really need to see the results in a nice format, I can paste it into JSON Editor Online

WARNING : There’s some pretty sensitive info in these outputs (just email -but still sensitive). Make sure you’re securing this and not just leaving in plaintext on your hard drive. If you’re going to keep them on your hard drive, I’d suggest putting them in an encrypted vault like Knox.

 

728x90-popads_1