Python script for generating Firebase ID and refresh tokens from a user ID (UID). Useful for testing & debugging.
ID tokens last for 1 hour (set by Firebase).
- Install firebase_admin:
$ pip install --user python_firebase
- Fill out the configuration constants in get_firebase_id_token.py
As an import (returns a dict):
import firebase_token_generator
uid = "Firebase user id"
print firebase_token_generator.get_token(uid)
Command line (prints only the ID token):
$ python firebase_token_generator.py <UID>