{ "info": { "author": "Canonical ISD Hackers", "author_email": "canonical-isd@lists.launchpad.net", "bugtrack_url": null, "classifiers": [], "description": "Django OAuth Backend\n====================\n\n`Django OAuth Backend`_ is a set of Django_ models which are required\nfor implementing OAuth_ protocol on the server side. Those models can\nbe used together with various other projects which implement HTTP part\nof the protocol. One such projects is `lazr.authentication`_.\n\n\nUsage\n-----\n\nUsage is quite simple.\n\nFirst thing is to add this application to Django's ``INSTALLED_APPS``\nlist::\n\n INSTALLED_APPS = (\n ...\n 'oauth_backend'\n )\n\nNext is to integrate it with OAuth_ protocol provider, like\n`lazr.authentication`_. It will look something like that::\n\n # Application's WSGI file\n from django.core.handlers.wsgi import WSGIHandler\n from lazr.authentication.wsgi import OAuthMiddleware\n from oauth_backend.models import DataStore, Consumer, Token\n\n\n def oauth_authenticate(oauth_consumer, oauth_token, parameters):\n try:\n consumer = Consumer.objects.get(\n user__username=oauth_consumer.key\n )\n token = Token.objects.get(token=oauth_token.key)\n if token.consumer.key == oauth_consumer.key:\n return consumer.user\n except (Token.DoesNotExist, Consumer.DoesNotExist):\n return None\n\n \n django = WSGIHandler()\n application = OAuthMiddleware(\n django, \n authenticate_with=oauth_authenticate,\n data_store=DataStore(),\n protect_path_pattern=\"/protected\"\n )\n\n\n.. note:: Where ``oauth_authenticate`` is function which checks that\n OAuth_ token is known. Additionally you can check that user\n associated with this token is allowed to use it, or that\n token itself is not expired. Because that part is highly\n dependant on the mechanisms of application itself it's not\n provided out of the box.\n\n\nHistory\n-------\n\nThis code was extracted from `Canonical Identity Provider`_\nproject. Although an extra effort was made to make sure that all\ndependencies are broken and this code is fully independent, it's\nconceivable that some small things were missed. In that case please\nreport those bugs on the `project's bug page`_.\n\n\n.. _OAuth: http://oauth.net/\n.. _Django: http://www.djangoproject.com/\n.. _Django OAuth Backend: http://launchpad.net/django-oauth-backend\n.. _lazr.authentication: http://launchpad.net/lazr.authentication\n.. _Canonical Identity Provider: http://launchpad.net/canonical-identity-provider\n.. _project's bug page: http://bugs.launchpad.net/django-oauth-backend\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "AGPLv3", "maintainer": null, "maintainer_email": null, "name": "django-oauth-backend", "package_url": "https://pypi.org/project/django-oauth-backend/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-oauth-backend/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/django-oauth-backend/0.2.3/", "requires_dist": null, "requires_python": null, "summary": "UNKNOWN", "version": "0.2.3" }, "last_serial": 4466033, "releases": { "0.2.3": [ { "comment_text": "", "digests": { "md5": "6e275d127ed7cabc86a3e6e8381a09ad", "sha256": "5e0c49dc1b5f289e9cae3042992f750f6bace6f0c01da9c0cac1849c8651b0e2" }, "downloads": -1, "filename": "django-oauth-backend-0.2.3.tar.gz", "has_sig": false, "md5_digest": "6e275d127ed7cabc86a3e6e8381a09ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6263, "upload_time": "2013-02-07T14:45:26", "url": "https://files.pythonhosted.org/packages/2f/06/92bf0e3754f9d5fddb111f222a6b5b486eb4c31784da0b5ef17aabc3e9eb/django-oauth-backend-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6e275d127ed7cabc86a3e6e8381a09ad", "sha256": "5e0c49dc1b5f289e9cae3042992f750f6bace6f0c01da9c0cac1849c8651b0e2" }, "downloads": -1, "filename": "django-oauth-backend-0.2.3.tar.gz", "has_sig": false, "md5_digest": "6e275d127ed7cabc86a3e6e8381a09ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6263, "upload_time": "2013-02-07T14:45:26", "url": "https://files.pythonhosted.org/packages/2f/06/92bf0e3754f9d5fddb111f222a6b5b486eb4c31784da0b5ef17aabc3e9eb/django-oauth-backend-0.2.3.tar.gz" } ] }