{ "info": { "author": "Baryshnikov Nikolay", "author_email": "mr.boiled@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 Firebase3 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-firebase3-auth\n```\n\nAdd the application to your project's `INSTALLED_APPS` in `settings.py`.\n\n```\nINSTALLED_APPS = [\n ...\n 'drf_firebase3_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_firebase3_auth.authentication.FirebaseAuthentication',\n ]\n}\n```\n\n\nThe `drf_firebase3_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_firebase3_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* 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/p141592/drf-firebase-auth", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "drf-firebase3-auth", "package_url": "https://pypi.org/project/drf-firebase3-auth/", "platform": "", "project_url": "https://pypi.org/project/drf-firebase3-auth/", "project_urls": { "Homepage": "https://github.com/p141592/drf-firebase-auth" }, "release_url": "https://pypi.org/project/drf-firebase3-auth/0.0.7/", "requires_dist": [ "firebase-admin (>=3.0.0)" ], "requires_python": "", "summary": "Custom Django Rest Framework authentication backend for parsing Firebase uid tokens and storing as local users.", "version": "0.0.7" }, "last_serial": 5907253, "releases": { "0.0.5": [ { "comment_text": "", "digests": { "md5": "5758963dd61f5dfb99eb7a7338e6d6de", "sha256": "5970da06ac4febbd6e61ea871dd0247f08c21896fecf698c8311ccbf015837d2" }, "downloads": -1, "filename": "drf_firebase3_auth-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "5758963dd61f5dfb99eb7a7338e6d6de", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8892, "upload_time": "2019-09-30T14:16:24", "url": "https://files.pythonhosted.org/packages/0b/7d/4718afe498ecf869ae65e0055c5e78357c063a921fe264c2a96a6012b691/drf_firebase3_auth-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "41a99e101f9f1a25ba1781bcb4fce880", "sha256": "a18645b0398726b6f82570437422e0ea58d97c470a0a1dacaa83c435fc674e6f" }, "downloads": -1, "filename": "drf-firebase3-auth-0.0.5.tar.gz", "has_sig": false, "md5_digest": "41a99e101f9f1a25ba1781bcb4fce880", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7056, "upload_time": "2019-09-30T14:16:27", "url": "https://files.pythonhosted.org/packages/da/56/217c6d20fcdc6ab3e981b9344ea2a710e51b0eb9f15c401498709e176ae3/drf-firebase3-auth-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "0bfe5ad5eef43bd69172700f2498ffc5", "sha256": "3d2270c861cec6026ed0e9db9e978d4e0223cdc68e79586451d994746101d90a" }, "downloads": -1, "filename": "drf_firebase3_auth-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "0bfe5ad5eef43bd69172700f2498ffc5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8893, "upload_time": "2019-09-30T14:38:20", "url": "https://files.pythonhosted.org/packages/2f/40/32cefb3245b3466e2c7d48ca60edb6b1cab7e88640fd1f21474c60d810b2/drf_firebase3_auth-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9ae52bfaddf15bc7c98e3ad0c45e80e3", "sha256": "17c0508b6576ede7c529d087ce2291032fe3530a2e22e585f29c2f4e994d0eb7" }, "downloads": -1, "filename": "drf-firebase3-auth-0.0.6.tar.gz", "has_sig": false, "md5_digest": "9ae52bfaddf15bc7c98e3ad0c45e80e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7055, "upload_time": "2019-09-30T14:38:22", "url": "https://files.pythonhosted.org/packages/66/d0/6fc7edff5ca28671e1bab42ca78a890bfcae822f698707d7f3225850ea44/drf-firebase3-auth-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "72b689bd0c267f95ef6255b7ca105b3c", "sha256": "eb29a05af19b96037b107aac11b18a5534ba136969fe069d80c87bbd99b531b2" }, "downloads": -1, "filename": "drf_firebase3_auth-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "72b689bd0c267f95ef6255b7ca105b3c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8895, "upload_time": "2019-09-30T14:45:16", "url": "https://files.pythonhosted.org/packages/b4/1b/71581bc9e8d38303399aecd4c99c0eaf7af7bbc392c8e730ade4494ec524/drf_firebase3_auth-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9320030b2f6ba0971df3ef8b2ad7a13f", "sha256": "b49c66197d1fe4cf7c20927d24bb0fa2b463d2750ba55dfcd1c338aeb2df1c9e" }, "downloads": -1, "filename": "drf-firebase3-auth-0.0.7.tar.gz", "has_sig": false, "md5_digest": "9320030b2f6ba0971df3ef8b2ad7a13f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7062, "upload_time": "2019-09-30T14:45:18", "url": "https://files.pythonhosted.org/packages/77/d4/d27d91ff1576c81dfc52d800c3329c1b19687951d1484999df4e5ed38b4e/drf-firebase3-auth-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "72b689bd0c267f95ef6255b7ca105b3c", "sha256": "eb29a05af19b96037b107aac11b18a5534ba136969fe069d80c87bbd99b531b2" }, "downloads": -1, "filename": "drf_firebase3_auth-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "72b689bd0c267f95ef6255b7ca105b3c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8895, "upload_time": "2019-09-30T14:45:16", "url": "https://files.pythonhosted.org/packages/b4/1b/71581bc9e8d38303399aecd4c99c0eaf7af7bbc392c8e730ade4494ec524/drf_firebase3_auth-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9320030b2f6ba0971df3ef8b2ad7a13f", "sha256": "b49c66197d1fe4cf7c20927d24bb0fa2b463d2750ba55dfcd1c338aeb2df1c9e" }, "downloads": -1, "filename": "drf-firebase3-auth-0.0.7.tar.gz", "has_sig": false, "md5_digest": "9320030b2f6ba0971df3ef8b2ad7a13f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7062, "upload_time": "2019-09-30T14:45:18", "url": "https://files.pythonhosted.org/packages/77/d4/d27d91ff1576c81dfc52d800c3329c1b19687951d1484999df4e5ed38b4e/drf-firebase3-auth-0.0.7.tar.gz" } ] }