{ "info": { "author": "Martin Brochhaus", "author_email": "mbrochh@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.0", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "# Django Facebook Login\n\n`django-facebook-login` provides an authentication backend and a GraphQL mutation\nthat takes a Facebook user-access-token and the user's email and then does one\nof the following:\n\n- Sign-up new user\n- Connect existing Django user with their Facebook account\n- Login existing, already connected Django user\n\nIn all cases, the user will be authenticated afterwards. This means, unlike\nmost other custom authentication backends, this backend will create a new\nuser if the given credentials (Facebook email + Facebook user access token)\nare not known, yet.\n\nMake sure you read the `Noteworthy Things` below before you decide to use this\nlibrary.\n\n# Quick start\n\n1. Add \"facebook-login\" to your INSTALLED_APPS setting like this:\n\n ```py\n INSTALLED_APPS = [\n ...\n 'facebook-login',\n ]\n ```\n\n1. Add the `FacebookAuthBackend` to your `AUTHENTICATION_BACKENDS` setting:\n\n ```py\n AUTHENTICATION_BACKENDS = (\n ...,\n \"facebook_login.auth_backends.FacebookAuthBackend\",\n )\n ```\n\n1. Hook up the mutation in your GraphQL schema:\n\n ```py\n # in your main `schema.py`:\n import graphene\n from facebook_login import schema as fb_login\n\n class Mutation(\n ...\n fb_login.Mutation,\n graphene.ObjectType,\n ):\n pass\n\n class Queries(...):\n pass\n\n schema = graphene.Schema(query=Queries, mutation=Mutation)\n ```\n\n1. Run `python manage.py migrate` to create the FacebookAccount table.\n\n1. Configure the app in your `local_settings.py`:\n\n ```\n # Get these values from https://developers.facebook.com/apps/\n FB_LOGIN_APP_ID = 'YOUR APP ID'\n FB_LOGIN_APP_SECRET = 'YOUR APP SECRET'\n ```\n\n# Noteworthy things\n\n## This library does not include frontend code\n\nYou still need extra code on your frontend that retrieves the user\naccess token from Facebook. Usually you would hook up the official Facebook\nlogin button that triggers the official Facebook login popup and then write\nsome code that sends the token that was returned by Facebook to our mutation.\n\n## This library forces the user to grant access to their Facebook email\n\nDuring the official Facebook login popup, the user can decide to revoke access\nto the email address. Other libraries, like django-allauth will have some extra\nviews where the user is then asked to enter an email anyways, after the Facebook\nlogin. We do not care about this. Instead, we will ask the user to press the\nlogin button again and this time please grant access to the email address.\n\n## This library does not return a JWT token or anything like it\n\nPlease note that we don't use JWT in our projects. We use Django's default\nsession based authentication. Therefore, our mutation does not return anything.\n\nOur mutation does call Django's `login()` function, which will save the new\nlogin-state into the user's session. When the mutation returns, it will instruct\nthe browser to save the new session key in the cookie. Our frontend will then\ntrigger a `window.location = /new/url/`, since this is a new request (including\nthe new session key), the server-rendered response will realize that this is a\nnow logged-in user.\n\nIf you would like to disable this behavior, you may provide a custom function\nfor the `FB_LOGIN_SUCCESS_HANDLER` setting (see below).\n\n# Configuration\n\nThis app uses the following settings:\n\n## FB_LOGIN_APP_ID (mandatory)\n\nThis should be your Facebook app-id.\n\n## FB_LOGIN_APP_SECRET (mandatory)\n\nThis should be your Facebook app secret.\n\n## FB_LOGIN_SUCCESS_HANDLER (optional)\n\n**Default**: `facebook_login.utils.success_handler_default`\n\nSet this to your own function in case you need to do additional things\nwhen a user logs in. You can find our original implementation in `utils.success_handler_default()`.\n\nYour custom function may return a string and that string would be passed on\nto the frontend by the mutation as the `extra` key. You will most likely want\nto return something like this: `json.dumps({'token': 'ABC123...'})`.\nIf you do return something (i.e. a JWT token), then the mutation will return\nit to the frontend as the `extra` key.\n\n## FB_LOGIN_API_BASE_URL (optional)\n\n**Default**: `'https://graph.facebook.com/v3.1'`\n\nAllows to override the base API URL, just in case. Of course, we are not sure,\nif a future API would be backwards compatible, so just changing this to a higher\nAPI version number might cause issues with this library.\n\n# Troubleshooting\n\n## KeyError: 'password'\n\nIf this happens, chances are that you are using `django-allauth`. Their\nauthentication backend crashes when Django's `authenticate()` function is\ncalled without a `username` and `password` keyword-argument. As a workaround,\nyou can just make sure that `facebook_login.auth_backends.FacebookAuthBackend`\nappears before other authentication backends.\n\n# Contributing\n\n- Clone this repo\n- `mkvirtualenv --python=python3.6 django-facebook-login`\n- `pip install -r requirements.txt`\n- `pip install -r test_requirements.txt`\n- `fab test`\n- `open htmlcov/index.html`\n- `./manage.py migrate` # This creates a sqlite3 DB\n- `./manage.py createsuperuser`\n- `./manage.py runserver`\n\nUnfortunately, running the local devserver only gives you access to the Django\nadmin. There is no demo-frontend code that would actually call this library's\nbackend code, yet.\n\n# Acknowledgements\n\nThis library was built with love at [The Artling](https://theartling.com)\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/theartling/django-facebook-login/", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "django-facebook-login", "package_url": "https://pypi.org/project/django-facebook-login/", "platform": "", "project_url": "https://pypi.org/project/django-facebook-login/", "project_urls": { "Homepage": "https://github.com/theartling/django-facebook-login/" }, "release_url": "https://pypi.org/project/django-facebook-login/4.0.0/", "requires_dist": [ "django (==2.0.8)", "graphene-django (==2.1.0)", "pytest; extra == 'dev'", "pytest-django; extra == 'dev'", "pytest-cov; extra == 'dev'", "responses; extra == 'dev'", "fabric; extra == 'dev'", "mixer; extra == 'dev'" ], "requires_python": "", "summary": "A GraphQL endpoint and authentication backend to signup or login a valid user access token from Facebook", "version": "4.0.0" }, "last_serial": 4295011, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "7692e01192a78ce3618781015a6369d5", "sha256": "100ed28b49d6ecd12bc87b22b7949ad291790099d9f6806caeb3e234dcfe4a92" }, "downloads": -1, "filename": "django_facebook_login-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7692e01192a78ce3618781015a6369d5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13068, "upload_time": "2018-09-17T09:33:01", "url": "https://files.pythonhosted.org/packages/63/8b/cf07ccd24f9d90ac5a6124d511c1cb713027379bb4ce8525eac25e5d088c/django_facebook_login-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ef7cc20e93d810040bcfd3b61b07032a", "sha256": "994bcc16a3d04a6bd783d004888d0455ecd7651b98f8376fe670942000471d65" }, "downloads": -1, "filename": "django-facebook-login-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ef7cc20e93d810040bcfd3b61b07032a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10482, "upload_time": "2018-09-17T09:33:03", "url": "https://files.pythonhosted.org/packages/0d/23/4081499e87c70f0e4aee464c01cc64505880e878f4a4c83b5aecb1426b28/django-facebook-login-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "5d607ab7ee7102b17b670aada08e4867", "sha256": "d569da56faad71c5496f67a1db1d1d4226dffd4d59aee7734eef418c1fb2d468" }, "downloads": -1, "filename": "django_facebook_login-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5d607ab7ee7102b17b670aada08e4867", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13334, "upload_time": "2018-09-18T02:35:48", "url": "https://files.pythonhosted.org/packages/39/b9/87b6b5dfb40ab54c600738771c70d5b23c1eab4a8722307dea2f11822e95/django_facebook_login-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c1f25f67f50cacb6370c97e0758f34ae", "sha256": "ea46205829153e2743adb308be9d1a568da44a026c3d5aefd1185c21f349f29e" }, "downloads": -1, "filename": "django-facebook-login-1.0.1.tar.gz", "has_sig": false, "md5_digest": "c1f25f67f50cacb6370c97e0758f34ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10658, "upload_time": "2018-09-18T02:35:50", "url": "https://files.pythonhosted.org/packages/a6/85/c4e537c6baf6776d00625753ac4e05341ad207ba96b8c3da82a376c07bf0/django-facebook-login-1.0.1.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "88f7150207ba4d2c1f70e725fd5fb3ae", "sha256": "6418a337f1094a919a66367f8258827a8ee52380a2bf687830af5b71c02d9dee" }, "downloads": -1, "filename": "django_facebook_login-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "88f7150207ba4d2c1f70e725fd5fb3ae", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14234, "upload_time": "2018-09-18T03:35:18", "url": "https://files.pythonhosted.org/packages/78/25/091980061da4764bca64dff11a77d8791330c682bef30622b023508512ae/django_facebook_login-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d40adeb985f642d678df154920d5f63e", "sha256": "e050f10ccf5d227b9f52c493c6ea93c44a1362685f660a43a62f0ae4dea97d13" }, "downloads": -1, "filename": "django-facebook-login-1.0.3.tar.gz", "has_sig": false, "md5_digest": "d40adeb985f642d678df154920d5f63e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12514, "upload_time": "2018-09-18T03:35:20", "url": "https://files.pythonhosted.org/packages/7a/b1/3e74f9562c6c2916157a7e01d8b73ac80ec1afd5de3846d078d67bb9b800/django-facebook-login-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "9fd0ea7bf496599ca4802c7686daa49f", "sha256": "502c8fb20f72c2b9c215fa4c8f80dba0419db77925130ab4fc168a3345e01d4f" }, "downloads": -1, "filename": "django_facebook_login-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "9fd0ea7bf496599ca4802c7686daa49f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14235, "upload_time": "2018-09-18T03:46:10", "url": "https://files.pythonhosted.org/packages/ec/3c/3049272eafb833b1a1dde7adab7b864be72e6c11b56ce24d1f83c28033c3/django_facebook_login-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c81d0cb067945b2813626050eff740a1", "sha256": "543cf43ede48ef67a97d5e205ae2e8286d0bf818797c66d58674928cb077e139" }, "downloads": -1, "filename": "django-facebook-login-1.0.4.tar.gz", "has_sig": false, "md5_digest": "c81d0cb067945b2813626050eff740a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12511, "upload_time": "2018-09-18T03:46:12", "url": "https://files.pythonhosted.org/packages/25/a9/491ce55b9b4a0a5e02f2d2778af8179c30d0e3a16fc533fe54603fa9c432/django-facebook-login-1.0.4.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "4976104a4c3341a98b0feb6f3593d745", "sha256": "436d63930b9d404a42cda5835f35b9b34853c1a2c1fbc93dc7be1429ade28492" }, "downloads": -1, "filename": "django_facebook_login-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4976104a4c3341a98b0feb6f3593d745", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14273, "upload_time": "2018-09-18T04:04:51", "url": "https://files.pythonhosted.org/packages/26/b9/4bdff40a47c8b1976c396053d48d36bb075830cf744e3d29c1ca02fd552a/django_facebook_login-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f7301244db54821c4a8638ce0041a165", "sha256": "0e5637371458e32dac6a0cc23138dc4f0961ebd391ae399720836fd7854d1268" }, "downloads": -1, "filename": "django-facebook-login-2.0.0.tar.gz", "has_sig": false, "md5_digest": "f7301244db54821c4a8638ce0041a165", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12602, "upload_time": "2018-09-18T04:04:53", "url": "https://files.pythonhosted.org/packages/b0/04/155c0eab41559d4de25ec3754e19c41dae83ddca817df259ef11e76966c4/django-facebook-login-2.0.0.tar.gz" } ], "3.0.0": [ { "comment_text": "", "digests": { "md5": "a1e38acc0eca83a8c3ac51fdfb4471ed", "sha256": "118daa1a9d7588454c72174426bcd053a0d9ca0840422fd689d592712b87d664" }, "downloads": -1, "filename": "django_facebook_login-3.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a1e38acc0eca83a8c3ac51fdfb4471ed", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14849, "upload_time": "2018-09-19T04:31:28", "url": "https://files.pythonhosted.org/packages/7a/24/ab880c061dd5483e35545c3a4cef7570a7f114bb74a83af6fd21165310d0/django_facebook_login-3.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dcad90f20c191a5ec4e63fe479818198", "sha256": "f9cbc8641b7983ee597f8ed6f5900cc8be891ad51570c5dc1e8a43e605f35be7" }, "downloads": -1, "filename": "django-facebook-login-3.0.0.tar.gz", "has_sig": false, "md5_digest": "dcad90f20c191a5ec4e63fe479818198", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13224, "upload_time": "2018-09-19T04:31:30", "url": "https://files.pythonhosted.org/packages/70/71/1a5de219723f8fa14f4e72da5142fb1ee9b2dffc6a88a562e3cfdd59613c/django-facebook-login-3.0.0.tar.gz" } ], "4.0.0": [ { "comment_text": "", "digests": { "md5": "e72a3901bc61174451de83b587df0af9", "sha256": "de674799c96dbfb0814e0cc89a63d3af53e8c247545159c4730ccc0f67929896" }, "downloads": -1, "filename": "django_facebook_login-4.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e72a3901bc61174451de83b587df0af9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17554, "upload_time": "2018-09-21T05:20:14", "url": "https://files.pythonhosted.org/packages/3b/5b/0f4505e16e9691ad2b79af3476c758a9b3dbf77a1befa42f17d9b0eac4f6/django_facebook_login-4.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d1648b2fcf79a80b8863097a9d835076", "sha256": "facb482dfee7436b3a0e4d639fecf0ad5b8dc4f7945367d90af13334485be392" }, "downloads": -1, "filename": "django-facebook-login-4.0.0.tar.gz", "has_sig": false, "md5_digest": "d1648b2fcf79a80b8863097a9d835076", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14913, "upload_time": "2018-09-21T05:20:16", "url": "https://files.pythonhosted.org/packages/0c/30/853fba65b0a41ed4771e54bb6c6002497e4c7ed4b148d12b65284590c7b0/django-facebook-login-4.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e72a3901bc61174451de83b587df0af9", "sha256": "de674799c96dbfb0814e0cc89a63d3af53e8c247545159c4730ccc0f67929896" }, "downloads": -1, "filename": "django_facebook_login-4.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e72a3901bc61174451de83b587df0af9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17554, "upload_time": "2018-09-21T05:20:14", "url": "https://files.pythonhosted.org/packages/3b/5b/0f4505e16e9691ad2b79af3476c758a9b3dbf77a1befa42f17d9b0eac4f6/django_facebook_login-4.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d1648b2fcf79a80b8863097a9d835076", "sha256": "facb482dfee7436b3a0e4d639fecf0ad5b8dc4f7945367d90af13334485be392" }, "downloads": -1, "filename": "django-facebook-login-4.0.0.tar.gz", "has_sig": false, "md5_digest": "d1648b2fcf79a80b8863097a9d835076", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14913, "upload_time": "2018-09-21T05:20:16", "url": "https://files.pythonhosted.org/packages/0c/30/853fba65b0a41ed4771e54bb6c6002497e4c7ed4b148d12b65284590c7b0/django-facebook-login-4.0.0.tar.gz" } ] }