{ "info": { "author": "Firebase", "author_email": "support@firebase.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "# Firebase Token Generator - Python\n\n[Firebase Custom Login](https://www.firebase.com/docs/web/guide/simple-login/custom.html)\ngives you complete control over user authentication by allowing you to authenticate users\nwith secure JSON Web Tokens (JWTs). The auth payload stored in those tokens is available\nfor use in your Firebase [security rules](https://www.firebase.com/docs/security/api/rule/).\nThis is a token generator library for Python which allows you to easily create those JWTs.\n\n\n## Installation\n\nThe Firebase Python token generator library is available via pip:\n\n```bash\n$ pip install firebase-token-generator\n```\n\n## A Note About Security\n\n**IMPORTANT:** Because token generation requires your Firebase Secret, you should only generate\ntokens on *trusted servers*. Never embed your Firebase Secret directly into your application and\nnever share your Firebase Secret with a connected client.\n\n\n## Generating Tokens\n\nTo generate tokens, you'll need your Firebase Secret which you can find by entering your Firebase\nURL into a browser and clicking the \"Secrets\" tab on the left-hand navigation menu.\n\nOnce you've downloaded the library and grabbed your Firebase Secret, you can generate a token with\nthis snippet of Python code:\n\n```python\nfrom firebase_token_generator import create_token\n\nauth_payload = {\"uid\": \"1\", \"auth_data\": \"foo\", \"other_auth_data\": \"bar\"}\ntoken = create_token(\"\", auth_payload)\n```\n\nThe payload passed to `create_token()` is made available for use within your\nsecurity rules via the [`auth` variable](https://www.firebase.com/docs/security/api/rule/auth.html).\nThis is how you pass trusted authentication details (e.g. the client's user ID)\nto your Firebase security rules. The payload can contain any data of your\nchoosing, however it must contain a \"uid\" key, which must be a string of less\nthan 256 characters. The generated token must be less than 1024 characters in\ntotal.\n\n\n## Token Options\n\nA second `options` argument can be passed to `create_token()` to modify how Firebase treats the\ntoken. Available options are:\n\n* **expires** (int or datetime) - A timestamp (as number of seconds since the epoch) or `datetime`\ndenoting the time after which this token should no longer be valid.\n\n* **notBefore** (int or datetime) - A timestamp (as number of seconds since the epoch) or `datetime`\ndenoting the time before which this token should be rejected by the server.\n\n* **admin** (bool) - Set to `True` if you want to disable all security rules for this client. This\nwill provide the client with read and write access to your entire Firebase.\n\n* **debug** (bool) - Set to `True` to enable debug output from your security rules. You should\ngenerally *not* leave this set to `True` in production (as it slows down the rules implementation\nand gives your users visibility into your rules), but it can be helpful for debugging.\n\n* **simulate** (bool) - If `True`, Firebase will run security rules but not actually make any\ndata changes. Note that this is internal-only for now.\n\nHere is an example of how to use the second `options` argument:\n\n```python\nfrom firebase_token_generator import create_token\n\nauth_payload = {\"uid\": \"1\", \"auth_data\": \"foo\", \"other_auth_data\": \"bar\"}\noptions = {\"admin\": True}\ntoken = create_token(\"\", auth_payload, options)\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/firebase/firebase-token-generator-python", "keywords": null, "license": "LICENSE", "maintainer": null, "maintainer_email": null, "name": "firebase-token-generator", "package_url": "https://pypi.org/project/firebase-token-generator/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/firebase-token-generator/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/firebase/firebase-token-generator-python" }, "release_url": "https://pypi.org/project/firebase-token-generator/2.0.1/", "requires_dist": null, "requires_python": null, "summary": "A utility to generate signed Firebase Authentication Tokens", "version": "2.0.1" }, "last_serial": 1518941, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "b037926a626ae436d73ffdad5e79dea4", "sha256": "51d8b57f5695177d7e3b2285d1825ce07b3f72b6f980bdb181d78434dbadd86f" }, "downloads": -1, "filename": "firebase-token-generator-1.0.tar.gz", "has_sig": false, "md5_digest": "b037926a626ae436d73ffdad5e79dea4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3525, "upload_time": "2013-01-24T17:51:37", "url": "https://files.pythonhosted.org/packages/62/a2/e069af8c0c639efb0fd92ffd9514ea33deec893328ef86badf8bf084022b/firebase-token-generator-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "1a85c59848838131759aeb7fc6c9466b", "sha256": "421f38be88a7ebc5560b71d5947ab666a5ce1b72db7ae660f0c93ccb42b07abd" }, "downloads": -1, "filename": "firebase-token-generator-1.1.tar.gz", "has_sig": false, "md5_digest": "1a85c59848838131759aeb7fc6c9466b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3508, "upload_time": "2013-01-24T18:41:55", "url": "https://files.pythonhosted.org/packages/25/d6/2a65abcf7d539113c9cd43ecede054d3cd219bff4447af2d6ccf765f6340/firebase-token-generator-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "644ee8a3f663988480d05c3cc6238761", "sha256": "4b66c86207e45b3a64b0fd0ffbf801c05e0cf291a5f632a2d5a23ffa07c6e222" }, "downloads": -1, "filename": "firebase-token-generator-1.2.tar.gz", "has_sig": false, "md5_digest": "644ee8a3f663988480d05c3cc6238761", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3513, "upload_time": "2013-01-24T19:01:00", "url": "https://files.pythonhosted.org/packages/1e/4e/0e55de9f4ca27e2fe600f895c9c8258c94e0098bbd26ad104e6dc8800e8b/firebase-token-generator-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "10f91d4a6928bbece9c7b2d42a9570b5", "sha256": "27901f71ac519772606645693e39d8f93c63333d6de61ba8f1ba62a8aee86428" }, "downloads": -1, "filename": "firebase-token-generator-1.3.tar.gz", "has_sig": false, "md5_digest": "10f91d4a6928bbece9c7b2d42a9570b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3562, "upload_time": "2013-04-28T19:18:28", "url": "https://files.pythonhosted.org/packages/19/f6/460163ca21495ec370b133bda340a7c981c35156aa59c7d3e67db06c2b45/firebase-token-generator-1.3.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "ed700ee28011bd0d86ba6ba2aad1d061", "sha256": "3d5ec83e1cd28591d98513cb66df471ae919e6064f9db85859b163e1e040f591" }, "downloads": -1, "filename": "firebase-token-generator-1.3.1.tar.gz", "has_sig": false, "md5_digest": "ed700ee28011bd0d86ba6ba2aad1d061", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3617, "upload_time": "2013-06-06T04:26:08", "url": "https://files.pythonhosted.org/packages/5b/68/7a1c92f6f1cc3951493efdea9c50abd0f9d660c049d2555ddca381eb3be3/firebase-token-generator-1.3.1.tar.gz" } ], "1.3.2": [ { "comment_text": "", "digests": { "md5": "638b68bf1fb3ba6b9764acb843d2c8ef", "sha256": "74b7367bb339e2ec9f60fbc49062c759676004478f8731f408920a7dc173c188" }, "downloads": -1, "filename": "firebase-token-generator-1.3.2.tar.gz", "has_sig": false, "md5_digest": "638b68bf1fb3ba6b9764acb843d2c8ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3762, "upload_time": "2013-09-24T22:47:04", "url": "https://files.pythonhosted.org/packages/1f/c1/8a7966f0d0007568ffc6ae9bd72e59cc1a8cb9cb0df9566d09e535144868/firebase-token-generator-1.3.2.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "a989b4b8f2bb42755fa29103f80622fd", "sha256": "2b187482b7284f2efed214c23a2d76d5da4df5b95e4915fad3dbe271e5f67f46" }, "downloads": -1, "filename": "firebase-token-generator-2.0.0.tar.gz", "has_sig": false, "md5_digest": "a989b4b8f2bb42755fa29103f80622fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4944, "upload_time": "2014-09-15T21:15:01", "url": "https://files.pythonhosted.org/packages/c5/b8/b9540aa12498e7cb636aeb7a8efd5319306386d351e670e82801520109b5/firebase-token-generator-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "7c8ab249e635aca10e8d4f21bb6d90c7", "sha256": "fbc721884823c2434ec55e15230d7cc7b2999c5f00f9300e5848a4d83d1ed68d" }, "downloads": -1, "filename": "firebase-token-generator-2.0.1.tar.gz", "has_sig": false, "md5_digest": "7c8ab249e635aca10e8d4f21bb6d90c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5027, "upload_time": "2015-04-24T00:46:34", "url": "https://files.pythonhosted.org/packages/36/f5/d09a193c1504eeb5bf80e7116628b60b8f9625b1565e2ca375dade9415bb/firebase-token-generator-2.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7c8ab249e635aca10e8d4f21bb6d90c7", "sha256": "fbc721884823c2434ec55e15230d7cc7b2999c5f00f9300e5848a4d83d1ed68d" }, "downloads": -1, "filename": "firebase-token-generator-2.0.1.tar.gz", "has_sig": false, "md5_digest": "7c8ab249e635aca10e8d4f21bb6d90c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5027, "upload_time": "2015-04-24T00:46:34", "url": "https://files.pythonhosted.org/packages/36/f5/d09a193c1504eeb5bf80e7116628b60b8f9625b1565e2ca375dade9415bb/firebase-token-generator-2.0.1.tar.gz" } ] }