{ "info": { "author": "Gary Burgmann", "author_email": "garyburgmann@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP" ], "description": "# DRF Firebase Auth\n\n## Requirements\n\n\n* Python (tested with 2.7, 3.6)\n* Django\n* Django Rest Framework\n\n\n\n## Installation\n\n```\n$ pip install drf-firebase-auth\n```\n\nAdd the application to your project's `INSTALLED_APPS` in `settings.py`.\n\n```\nINSTALLED_APPS = [\n ...\n 'drf_firebase_auth',\n]\n```\n\nIn your project's `settings.py`, add this to the `REST_FRAMEWORK` configuration. Note that if you want to retain access to the browsable API for locally created users, then you will probably want to keep `rest_framework.authentication.SessionAuthentication` too.\n\n\n```\nREST_FRAMEWORK = {\n ...\n 'DEFAULT_AUTHENTICATION_CLASSES': [\n ...\n 'rest_framework.authentication.SessionAuthentication',\n 'drf_firebase_auth.authentication.FirebaseAuthentication',\n ]\n}\n```\n\n\nThe `drf_firebase_auth` application comes with the following settings as default, which can be overridden in your project's `settings.py` file. Make sure to nest them within `DRF_FIREBASE_AUTH` as below:\n\n\n```\nDRF_FIREBASE_AUTH = {\n # path to JSON file with firebase secrets\n 'FIREBASE_SERVICE_ACCOUNT_KEY': '',\n # allow creation of new local user in db\n 'FIREBASE_CREATE_LOCAL_USER': True,\n # attempt to split firebase user.display_name and set local user\n # first_name and last_name\n 'FIREBASE_ATTEMPT_CREATE_WITH_DISPLAY_NAME': True,\n # commonly JWT or Bearer (e.g. JWT )\n 'FIREBASE_AUTH_HEADER_PREFIX': 'JWT',\n # verify that JWT has not been revoked\n 'FIREBASE_CHECK_JWT_REVOKED': True,\n # require that firebase user.email_verified is True\n 'FIREBASE_AUTH_EMAIL_VERIFICATION': False\n}\n```\n\nYou can get away with leaving all the settings as default except for `FIREBASE_SERVICE_ACCOUNT_KEY`, which is obviously required. As a minimum, you will need to set this in your project's `settings.py`. This must be the JSON service account key that you receive from the Firebase console for your application.\n\n```\n...\nDRF_FIREBASE_AUTH = {\n 'FIREBASE_SERVICE_ACCOUNT_KEY': 'project/config/firebase.json'\n}\n```\n\nNow that you have configured the application, run the migrations so that the Firebase data can be stored.\n\n```\n$ ./manage.py migrate drf_firebase_auth\n```\n\nAll you need to do now is have your client code handle the Firebase popup/redirect authentication flow, retrieve the idToken from the currentUser (Firebase explains this flow well in their docs: `https://firebase.google.com/docs/auth/admin/verify-id-tokens`), and then use the idToken for the user in an `Authorization` header in requests to your API.\n\n```\nJWT \n```\n\nVoila!\n\n## Contributing\n\n* Please raise an issue/feature and name your branch 'feature-n' or 'issue-n', where 'n' is the issue number.\n* If you test this code with a Python version not listed above and all is well, please fork and update the README to include the Python version you used :)\n* I almost always setup Django with a custom user class inheriting from AbstractUser, where I switch the USERNAME_FIELD to be 'email'. This backend is setup to assign a username still anyway, but if there are any issues, please raise them and/or make a pull request to help the community!\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/garyburgmann/drf-firebase-auth", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "drf-firebase-auth", "package_url": "https://pypi.org/project/drf-firebase-auth/", "platform": "", "project_url": "https://pypi.org/project/drf-firebase-auth/", "project_urls": { "Homepage": "https://github.com/garyburgmann/drf-firebase-auth" }, "release_url": "https://pypi.org/project/drf-firebase-auth/0.0.6/", "requires_dist": [ "firebase-admin (>=2.0.0)" ], "requires_python": "", "summary": "Custom Django Rest Framework authentication backend for parsing Firebase uid tokens and storing as local users.", "version": "0.0.6" }, "last_serial": 5908731, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "0778580efc9cd266ef5ad65e6337ede1", "sha256": "84b106ea64c27f585ec3d1e55a1dba760fd7f32555935725987272fbd2a968fa" }, "downloads": -1, "filename": "drf-firebase-auth-0.0.1.tar.gz", "has_sig": false, "md5_digest": "0778580efc9cd266ef5ad65e6337ede1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10291, "upload_time": "2019-02-10T12:42:40", "url": "https://files.pythonhosted.org/packages/9f/83/b1553f5b2c09d079f74c5fb28ceb66e86ecf51874404d8e05dc70b622b02/drf-firebase-auth-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "c285b9ea1adbcb792e1046bef4fd705f", "sha256": "a12d95e51c6608324acf9c96a5b2b279a4001d287c51961cc503662214b1349e" }, "downloads": -1, "filename": "drf-firebase-auth-0.0.2.tar.gz", "has_sig": false, "md5_digest": "c285b9ea1adbcb792e1046bef4fd705f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10296, "upload_time": "2019-02-10T12:42:43", "url": "https://files.pythonhosted.org/packages/7c/cd/f06a7fe3b0e98615b716fa1a358d22f8e012a256dadf50b5644adcb414e2/drf-firebase-auth-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "65a1662235a69679723e91234d6a34d6", "sha256": "ac207f29a7306307e5a3b3c751f601871d69cc4b0da3e65800099afae7a07f07" }, "downloads": -1, "filename": "drf-firebase-auth-0.0.3.tar.gz", "has_sig": false, "md5_digest": "65a1662235a69679723e91234d6a34d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10306, "upload_time": "2019-02-10T12:47:44", "url": "https://files.pythonhosted.org/packages/ba/f9/8ea51fb09291b30057f607aa689e967f63f9db21cce13c9efde369dcf575/drf-firebase-auth-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "75eae6bfbd45c1e186b32a0768948cf9", "sha256": "f14bf277d3e2de139e715b6705ff64f2bb6f5c4f253822a55c4472f4179169fb" }, "downloads": -1, "filename": "drf-firebase-auth-0.0.4.tar.gz", "has_sig": false, "md5_digest": "75eae6bfbd45c1e186b32a0768948cf9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10330, "upload_time": "2019-02-11T04:48:48", "url": "https://files.pythonhosted.org/packages/60/fc/06c758d94d0deaaec61d244ea5fb6bfdc238752070b6e70abd1e25ab911c/drf-firebase-auth-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "9f5493b2c232e6ff2b61f9ec298a342d", "sha256": "7d70d26092e3d10d82ab89e253fa0fe5e85e5ef2cb744528730370932f32d5c8" }, "downloads": -1, "filename": "drf_firebase_auth-0.0.5-py2-none-any.whl", "has_sig": false, "md5_digest": "9f5493b2c232e6ff2b61f9ec298a342d", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14402, "upload_time": "2019-09-30T20:02:17", "url": "https://files.pythonhosted.org/packages/06/7e/df859af40ead7e75c2efafdbcd5e70329c174841d2f0c519464b09f9def4/drf_firebase_auth-0.0.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "649f3d0de7524e3a14775c58a82dfdfb", "sha256": "dfabb6617fc81a976dfb7d2485b695febfb7dd5a151ed83e0ae87d8919d18367" }, "downloads": -1, "filename": "drf-firebase-auth-0.0.5.tar.gz", "has_sig": false, "md5_digest": "649f3d0de7524e3a14775c58a82dfdfb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11519, "upload_time": "2019-09-30T20:02:19", "url": "https://files.pythonhosted.org/packages/ca/b3/0e50fae4f800bbc20e2e60df66a9b52064afc077466c71b100fb07bcd178/drf-firebase-auth-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "075e190680d5c11f991cfa8000d131f3", "sha256": "f44c7b721f5e9512ee71dd9ce3289781a77f94e1a20cbbfdc299a1c937f9c178" }, "downloads": -1, "filename": "drf_firebase_auth-0.0.6-py2-none-any.whl", "has_sig": false, "md5_digest": "075e190680d5c11f991cfa8000d131f3", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14427, "upload_time": "2019-09-30T20:09:24", "url": "https://files.pythonhosted.org/packages/a6/78/5277d8d9e309ed56059b00c00189520a6a1764e5bca58413c8878de540c7/drf_firebase_auth-0.0.6-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b562b3777f38ef95ab90813f5eeba084", "sha256": "3c3f395c16a189d85984b8bc2ab5f5289ba056a4a4a95c0eaf8b948622c2caef" }, "downloads": -1, "filename": "drf-firebase-auth-0.0.6.tar.gz", "has_sig": false, "md5_digest": "b562b3777f38ef95ab90813f5eeba084", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11605, "upload_time": "2019-09-30T20:09:26", "url": "https://files.pythonhosted.org/packages/4e/ab/75d14b67aaf0b0fd08fc576eae4850fa3b94aba9ef80aea472d6abb5275b/drf-firebase-auth-0.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "075e190680d5c11f991cfa8000d131f3", "sha256": "f44c7b721f5e9512ee71dd9ce3289781a77f94e1a20cbbfdc299a1c937f9c178" }, "downloads": -1, "filename": "drf_firebase_auth-0.0.6-py2-none-any.whl", "has_sig": false, "md5_digest": "075e190680d5c11f991cfa8000d131f3", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14427, "upload_time": "2019-09-30T20:09:24", "url": "https://files.pythonhosted.org/packages/a6/78/5277d8d9e309ed56059b00c00189520a6a1764e5bca58413c8878de540c7/drf_firebase_auth-0.0.6-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b562b3777f38ef95ab90813f5eeba084", "sha256": "3c3f395c16a189d85984b8bc2ab5f5289ba056a4a4a95c0eaf8b948622c2caef" }, "downloads": -1, "filename": "drf-firebase-auth-0.0.6.tar.gz", "has_sig": false, "md5_digest": "b562b3777f38ef95ab90813f5eeba084", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11605, "upload_time": "2019-09-30T20:09:26", "url": "https://files.pythonhosted.org/packages/4e/ab/75d14b67aaf0b0fd08fc576eae4850fa3b94aba9ef80aea472d6abb5275b/drf-firebase-auth-0.0.6.tar.gz" } ] }