{ "info": { "author": "Alex Kovrigin", "author_email": "a.kovrigin0@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "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 (Forked from [drf-firebase-auth by garyburgman](https://github.com/garyburgmann/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-cavoke\n```\n\nAdd the application to your project's `INSTALLED_APPS` in `settings.py`.\n\n```\nINSTALLED_APPS = [\n ...\n 'drf_firebase_auth_cavoke',\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_cavoke.authentication.FirebaseAuthentication',\n ]\n}\n```\n\n\nThe `drf_firebase_auth_cavoke` 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_cavoke` as below:\n\n\n```\ndrf_firebase_auth_cavoke = {\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_cavoke = {\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_cavoke\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* 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/cavoke-project/drf-firebase-auth-cavoke", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "drf-firebase-auth-cavoke", "package_url": "https://pypi.org/project/drf-firebase-auth-cavoke/", "platform": "", "project_url": "https://pypi.org/project/drf-firebase-auth-cavoke/", "project_urls": { "Homepage": "https://github.com/cavoke-project/drf-firebase-auth-cavoke" }, "release_url": "https://pypi.org/project/drf-firebase-auth-cavoke/0.0.7/", "requires_dist": [ "firebase-admin (>=2.0.0)" ], "requires_python": "", "summary": "Custom DRF authentication backend.", "version": "0.0.7" }, "last_serial": 5550326, "releases": { "0.0.5": [ { "comment_text": "", "digests": { "md5": "015c7f842107b683f3ea8a13c54cfe6b", "sha256": "326a3d54c345bc5b72574cace206f3d98d4438aabc647bf1ef8a9bd7a2f439ab" }, "downloads": -1, "filename": "drf_firebase_auth_cavoke-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "015c7f842107b683f3ea8a13c54cfe6b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8810, "upload_time": "2019-07-16T17:12:50", "url": "https://files.pythonhosted.org/packages/3b/59/8653bbabdc5b48e5d7bd2825e599aac8b3b2c1d56faaef187990a2384a2e/drf_firebase_auth_cavoke-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "921dc853f4600c9d630b3d7af332c248", "sha256": "3472c851f1126c7d987662d8ca7f9a84af9bc22e2f704a225d5b06f52367f3a5" }, "downloads": -1, "filename": "drf-firebase-auth-cavoke-0.0.5.tar.gz", "has_sig": false, "md5_digest": "921dc853f4600c9d630b3d7af332c248", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7009, "upload_time": "2019-07-16T17:12:52", "url": "https://files.pythonhosted.org/packages/5f/03/6a0649378cccc2188385825b8599a0539537b0cab366c4fa2bbce24180d0/drf-firebase-auth-cavoke-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "563374f04b659386654e648239fcf2e2", "sha256": "a4f5924a872cacb3eb639d81fb7388b0764ddf0e55340e8792cb1806b0970315" }, "downloads": -1, "filename": "drf_firebase_auth_cavoke-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "563374f04b659386654e648239fcf2e2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8818, "upload_time": "2019-07-16T19:01:21", "url": "https://files.pythonhosted.org/packages/57/e8/09010eded10ab2adc49bf1e407ebbbd831d110d2cdfb131240ae2a7b9fba/drf_firebase_auth_cavoke-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "109fa4e252d33266e9a1e1b659e25349", "sha256": "51f811146ca47266361dc4c5806aeedce85f64ae8d3981f515dbd454d5cd180b" }, "downloads": -1, "filename": "drf-firebase-auth-cavoke-0.0.6.tar.gz", "has_sig": false, "md5_digest": "109fa4e252d33266e9a1e1b659e25349", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7023, "upload_time": "2019-07-16T19:01:24", "url": "https://files.pythonhosted.org/packages/9c/c8/d2170127a4e5fb82d5b874a68b267bbca42b11aef7534ba51db1e430363a/drf-firebase-auth-cavoke-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "02db837f5a608b9a6cd73d31498338bc", "sha256": "288c5decf03fbe3294ecc69c63e2f5f07b38cd04384279fdf98b93bc5e29f70d" }, "downloads": -1, "filename": "drf_firebase_auth_cavoke-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "02db837f5a608b9a6cd73d31498338bc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8902, "upload_time": "2019-07-18T10:18:21", "url": "https://files.pythonhosted.org/packages/01/90/e83d6f34bca02106881a0d83ad56ec10a2b2afe12a82c130b35b90390b4e/drf_firebase_auth_cavoke-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "14b1218bc83086cf3ee3dc7dd0c0b4e8", "sha256": "0ef7c48b2aad7c75ace05ee2977337aff5dea432a7328134f510bb8c47d8323c" }, "downloads": -1, "filename": "drf-firebase-auth-cavoke-0.0.7.tar.gz", "has_sig": false, "md5_digest": "14b1218bc83086cf3ee3dc7dd0c0b4e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7107, "upload_time": "2019-07-18T10:18:24", "url": "https://files.pythonhosted.org/packages/dd/38/b8cbaf6178d3d0eeeadb092726fa8a5d2feead9c36536a68c9698197d8af/drf-firebase-auth-cavoke-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "02db837f5a608b9a6cd73d31498338bc", "sha256": "288c5decf03fbe3294ecc69c63e2f5f07b38cd04384279fdf98b93bc5e29f70d" }, "downloads": -1, "filename": "drf_firebase_auth_cavoke-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "02db837f5a608b9a6cd73d31498338bc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8902, "upload_time": "2019-07-18T10:18:21", "url": "https://files.pythonhosted.org/packages/01/90/e83d6f34bca02106881a0d83ad56ec10a2b2afe12a82c130b35b90390b4e/drf_firebase_auth_cavoke-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "14b1218bc83086cf3ee3dc7dd0c0b4e8", "sha256": "0ef7c48b2aad7c75ace05ee2977337aff5dea432a7328134f510bb8c47d8323c" }, "downloads": -1, "filename": "drf-firebase-auth-cavoke-0.0.7.tar.gz", "has_sig": false, "md5_digest": "14b1218bc83086cf3ee3dc7dd0c0b4e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7107, "upload_time": "2019-07-18T10:18:24", "url": "https://files.pythonhosted.org/packages/dd/38/b8cbaf6178d3d0eeeadb092726fa8a5d2feead9c36536a68c9698197d8af/drf-firebase-auth-cavoke-0.0.7.tar.gz" } ] }