0.2.0 • Published 6 years ago

fbatg v0.2.0

Weekly downloads
35
License
-
Repository
github
Last release
6 years ago

FBATG

Firebase Auth Token Generator.

This is a simple little CLI for generating a firebase auth token.

Table of Contents

  1. Motivation
  2. Installation
  3. Init
  4. Logging in
  5. Generating a token
  6. Contributing

Motivation

I was building a REST api which was using firebase for authorization, and needed to test some endpoints. The client side of the application hadn't yet been built though, so there was no way for me to (easily) obtain an auth token to hit my api with.

Thus, this little tool was born. It's pretty simple really - you configure it with your firebase details, sign in with firebase, and receive an auth token. Easy.

Installation

You can install it locally or globally with npm. Personally, I prefer globally so that I can easily use it anywhere.

npm install -g fbatg

Init

Before you can generate a token, you need to initialize the CLI with your firebase auth details.

You'll need to create a JSON file with your firebase config details in it, that looks like the following:

{
  "apiKey": "<FB_API_KEY>",
  "authDomain": "<FB_PROJECT>.firebaseapp.com",
  "databaseUrl": "https://<FB_PROJECT>.firebaseio.com",
  "projectId": "<FB_PROJECT>",
  "storageBucket": "<FB_PROJECT>.appspot.com",
  "messagingSenderId": "<FB_MESSAGING_SENDER_ID>"
}

You can easily obtain these details from your firebase console.

Once you have this json file, you can simple return

fbatg init <path_to_file> --config-name <name_your_config>

Note that the --config-name option is required.

Once you get the success message from that, you're good to move on.

Logging in

Now that you've initialized the CLI, you need to log into the firebase auth account you want a token for.

Simply run

fbatg login

and you should get a prompt to enter an email and password.

Assuming you successfully log in, you'll now be able to move on and generate an auth token.

Generating a token

The final step! Now that you have init'ed the CLI, and logged in, you can start generating auth tokens.

fbatg

If you've done everything properly so far, this should log you a firebase auth token - much success!

If you have any trouble, feel free to file an issue.

Contributing

There are still few things I'd like to do with this project, and would happily accept any PRs for bug fixes or relevant changes.

If you'd like to submit a PR, please just try to follow the style of the rest of the codebase.

Made by brockwills
0.2.0

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago