A utility to generate signed Firebase Authentication Tokens
Project description
# PyFirebaseTokenGenerator
A Python library for generating JWT that can be used for authentication in a Firebase app.
## Installation
pip install firebase-token-generator
## Usage
Using the library to generate a valid, signed token:
from firebase_token_generator import create_token
SECRET = ‘<YOUR FIREBASE APP SECRET>’ custom_data = {‘auth_data’: ‘foo’, ‘other_auth_data’: ‘bar’} options = {‘admin’: True}
token = create_token(SECRET, custom_data, options)
The options argument is an optional dictionary of additional properties for the token. The list of possible options is:
- expires - epoch time after which the token will be considered invalid
- notBefore - epoch time before which the token will be considered invalid
- admin - if set to True, this client will bypass security rules
- debug - if set to True, the client will receive information about security rule execution
- simulate - (internal-only for now) if True, Firebase will run security rules but not actually make any data changes
See the [Firebase Authentication Docs](https://www.firebase.com/docs/security/authentication.html) for more information about authentication tokens.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size firebase-token-generator-1.2.tar.gz (3.5 kB) | File type Source | Python version None | Upload date | Hashes View |
Hashes for firebase-token-generator-1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b66c86207e45b3a64b0fd0ffbf801c05e0cf291a5f632a2d5a23ffa07c6e222 |
|
MD5 | 644ee8a3f663988480d05c3cc6238761 |
|
BLAKE2-256 | 1e4e0e55de9f4ca27e2fe600f895c9c8258c94e0098bbd26ad104e6dc8800e8b |