Skip to content

Automatically generate JWTs for your firebase project for testing purposes

License

Notifications You must be signed in to change notification settings

Charles-Johnson/firebase-token-generation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of how to create custom firebase ID tokens

Setup

  • Make sure you have node v10.23.0 installed
$ npm install
  • Create a firebase project by visiting console.firebase.google.com
  • Create a Firebase Admin SDK service account for the firebase project
  • Download the service account as a JSON file and save as google_service_account.json in this repo's root directory
  • Copy the Web API Key from the firebase console in the project's Settings > General

Create a token

  • The following will create a token for a user with UID, test, and email, somebody@example.com.
$ WEB_API_KEY=<secret> node index.js
  • Modify the arguments of the createCustomToken method call in index.js to mimic different users with different properties

About

Automatically generate JWTs for your firebase project for testing purposes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published