{ "info": { "author": "Jonathan Ehwald", "author_email": "pypi@ehwald.info", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "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", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP" ], "description": "# Django Rest Framework Firebase Authentication\n\nThis package provides a base Firebase Authentication backend class for the Django rest framework. Two key methods are not implemented for more flexebility. Let's [keep it simple, stupid](https://en.wikipedia.org/wiki/KISS_principle).\n\n## Requirements\n\n- Python 2.7 or 3.4+\n- [Django](https://github.com/django/django) (version 1.11+)\n- [Django Rest Framework](https://github.com/encode/django-rest-framework)\n- [Firebase Admin Python](https://github.com/firebase/firebase-admin-python)\n\n## Installation\n\n```pip install drf-firebase-authentication```\n\n## Usage\n\n#### 1. Subclass `BaseFirebaseAuthentication` and implement its template methods:\n\nDecide by yourself how you want to associate Firebase users with local django users by implementing the `.get_django_user()` method accordingly.\n\nPut your code into a `authentication.py` file inside an app dedicated to your projects REST Api.\n\n```python\nfrom drf_firebase.authentication import BaseFirebaseAuthentication\nfrom firebase_admin import credentials, initialize_app\nfrom django.contrib.auth import get_user_model\n\nfirebase_creds = credentials.Certificate('path/to/firebase/credentials.json')\nfirebase_app = initialize_app(firebase_creds)\n\nclass FirebaseAuthentication(BaseFirebaseAuthentication):\n\t\"\"\"\n\tExample implementation of a DRF Firebase Authentication backend class\n\t\"\"\"\n\tdef get_firebase_app(self):\n\t\treturn firebase_app\n\n\tdef get_django_user(self, firebase_user_record):\n\t\treturn get_user_model().objects.get_or_create(\n\t\t\tusername=firebase_user_record.uid,\n\t\t)[0]\n```\n\n#### 2. Add the just created Firebase authentication backend to your `settings.py`:\n\nReplace `YOUR_RESTAPI_APP` with the app you put your `authentication.py` file in.\n\n```python\nREST_FRAMEWORK = {\n\t'DEFAULT_AUTHENTICATION_CLASSES': (\n\t\t'rest_framework.authentication.SessionAuthentication', # default\n\t\t'rest_framework.authentication.BasicAuthentication', # default\n\t\t'YOUR_RESTAPI_APP.authentication.FirebaseAuthentication',\n\t),\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/DoctorJohn/drf-firebase-authentication", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "drf-firebase-authentication", "package_url": "https://pypi.org/project/drf-firebase-authentication/", "platform": "", "project_url": "https://pypi.org/project/drf-firebase-authentication/", "project_urls": { "Homepage": "https://github.com/DoctorJohn/drf-firebase-authentication" }, "release_url": "https://pypi.org/project/drf-firebase-authentication/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "A flexible Django Rest Framework Firebase authentication class", "version": "1.0.0" }, "last_serial": 5977001, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "74caa2ecbc0e8c4f5b19c6af376ca61e", "sha256": "3a50817018433041356197d5f46d88d4cfb6f63204888463240f0033d620567a" }, "downloads": -1, "filename": "drf_firebase_authentication-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "74caa2ecbc0e8c4f5b19c6af376ca61e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5070, "upload_time": "2019-05-03T12:48:45", "url": "https://files.pythonhosted.org/packages/d7/eb/ee83d97172fe9e7bf1313cfe20de05796379c7ed61cda70dba66bac34d85/drf_firebase_authentication-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f4c548154e8b31e8d0ffd00aa261d270", "sha256": "400acefca15da2e9eb20c61afbecb7d999f04972984c3f35bd03b0398915f36a" }, "downloads": -1, "filename": "drf-firebase-authentication-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f4c548154e8b31e8d0ffd00aa261d270", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3575, "upload_time": "2019-05-03T12:48:47", "url": "https://files.pythonhosted.org/packages/10/81/8821b986fca15c6407f19eccaa7850774928eb3e60658299571749e8ea35/drf-firebase-authentication-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7ca4550bf31fe270c52f1548b19cfaea", "sha256": "0922defa86fc663ce56b0a13c88ba23c08f2771ad0303311a9b02b61d2b08700" }, "downloads": -1, "filename": "drf_firebase_authentication-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7ca4550bf31fe270c52f1548b19cfaea", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5099, "upload_time": "2019-05-03T13:00:28", "url": "https://files.pythonhosted.org/packages/ab/e7/1bc412ab0f886d3fb272814410bf7a4675edc05486885d0ffdffea8ba965/drf_firebase_authentication-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c4359d4cf2fb1f1b2d0a9223489df4e", "sha256": "c26cadab3390f1ab8ef39a1cba162d6635689e6944029dbb2ee66c1a37ab49a4" }, "downloads": -1, "filename": "drf-firebase-authentication-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8c4359d4cf2fb1f1b2d0a9223489df4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3608, "upload_time": "2019-05-03T13:00:30", "url": "https://files.pythonhosted.org/packages/68/a3/262c65c57151cc94cf295c03d4d4afdc5759cd11b9aaaea5bf75f35c6438/drf-firebase-authentication-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "48faf8b9b313566aa4e33886cd03d50f", "sha256": "2d1dcb593a892b9ba2df980c44819368bb5a1fbe84cfcfe2ad8d602cbf09a0bd" }, "downloads": -1, "filename": "drf_firebase_authentication-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "48faf8b9b313566aa4e33886cd03d50f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5101, "upload_time": "2019-05-03T13:04:38", "url": "https://files.pythonhosted.org/packages/f6/a0/e5097e4112916043c3ea3b93f73da59a8b110632648f62dabed350b7badb/drf_firebase_authentication-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "04ddbcf13b443f51cc68a7020525c8f5", "sha256": "4cb13627e40f717222be85e21fb8bec99a20f30934d6f938c27121aa5d8a3408" }, "downloads": -1, "filename": "drf-firebase-authentication-0.1.2.tar.gz", "has_sig": false, "md5_digest": "04ddbcf13b443f51cc68a7020525c8f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3618, "upload_time": "2019-05-03T13:04:40", "url": "https://files.pythonhosted.org/packages/ba/e2/dc31e9a8b7594331a97808f81b91bd7402612ee8bd793cc14bd8b2e7c40b/drf-firebase-authentication-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "be778149264df5058521f189ba7b0a5a", "sha256": "792a526d77a2417c123e10f2864064712cd56cd9af63bd651edca7c7e90f6d5c" }, "downloads": -1, "filename": "drf-firebase-authentication-0.1.3.tar.gz", "has_sig": false, "md5_digest": "be778149264df5058521f189ba7b0a5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3613, "upload_time": "2019-10-15T10:33:37", "url": "https://files.pythonhosted.org/packages/ea/00/006cde8bf0473224f626eb7e85deda2cab7b9acc12c3b4f8c54235fc21af/drf-firebase-authentication-0.1.3.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "b62212b7eb76beb2e236ec437f0f4a26", "sha256": "9d23ccd5be114772d697cadb7f6faf68c1e144e462d231f520229490f88d9623" }, "downloads": -1, "filename": "drf-firebase-authentication-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b62212b7eb76beb2e236ec437f0f4a26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3725, "upload_time": "2019-10-15T13:15:59", "url": "https://files.pythonhosted.org/packages/7b/b7/c166fd4300f7db90079698bd43747a14cad84647e1fd6ffb3fad5ccbb922/drf-firebase-authentication-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b62212b7eb76beb2e236ec437f0f4a26", "sha256": "9d23ccd5be114772d697cadb7f6faf68c1e144e462d231f520229490f88d9623" }, "downloads": -1, "filename": "drf-firebase-authentication-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b62212b7eb76beb2e236ec437f0f4a26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3725, "upload_time": "2019-10-15T13:15:59", "url": "https://files.pythonhosted.org/packages/7b/b7/c166fd4300f7db90079698bd43747a14cad84647e1fd6ffb3fad5ccbb922/drf-firebase-authentication-1.0.0.tar.gz" } ] }