{ "info": { "author": "Jean Ribes", "author_email": "jean@ribes.me", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "Ressource Server Utilities\n==========================\n\nIf you've read RFCs on OAuth or (more likely) the **django-oauth-toolkit** docs, you know that a *Ressource Server* sorts\nof delegates user authentication to the *Authorization Server*.\n\nBut the current implementation in *Django OAuth Toolkit* only copies the username from the *Authorization Server* in its\ndatabase. This implies that all users have no special permissions, i.e. you lose administrator rights when you access\nthe *Ressource Server* !\n\nThe class FullUserOAuthBackend aims to fix this by fetching the full user model from the *Authorization Server* after\nyou've accessed the *Ressource Server*.\n\nInstallation\n------------\n`pip install oauth-slave-accounts`\n\nSetup\n-----\nAuthorization Server\n~~~~~~~~~~~~~~~~~~~~\nYou need to create an endpoint that exposes user data in a json manner (or further override my methods), the easiest being\na DjangoRestFramework ModelViewset.\nThe current implementation uses the user's Authorization token as `lookup_field`.\n\n.. code:: python\n\n class UserViewSet(viewset.ReadOnlyModelViewSet):\n queryset = User.objects.all()\n serializer_class = UserSerializer\n permission_classes = [ServerServerPermission]\n def get_object(self):\n return AccessToken.objects.get(token=self.kwargs.get('pk')).user\n..\n\n **pro tip:** you should exclude the password from the serializer, because its confidential even if salted, and furthermore its useability probably depends on the `SECRET_KEY`\n\nRessource Server\n~~~~~~~~~~~~~~~~\nSubclass `ressource_server_utils.backend.FullUserOAuthBackend` and override the following :\n * property fetch_url : a string that describes your *Authorization Server*'s endpoint to get User data e.g. `http://auth.srv/user/{}/`\n * property UserSerializer : a DjangoRestFramework Serializer that defines how to parse your *Authorization Server*'s response\n * And optionnally\n - method get_auth_token()\n - method refresh_auth_token()", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "oauth-slave-accounts", "package_url": "https://pypi.org/project/oauth-slave-accounts/", "platform": "", "project_url": "https://pypi.org/project/oauth-slave-accounts/", "project_urls": null, "release_url": "https://pypi.org/project/oauth-slave-accounts/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Custom Django Oauth backend for Ressource Servers to download full user data fom Authorization Server", "version": "0.1.1" }, "last_serial": 4159351, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "14c853d14b293f1b40c2763757b1a813", "sha256": "c0361fa155935f94b286eac526b2b0ddad8ca5a5416a0246209595716150d924" }, "downloads": -1, "filename": "oauth-slave-accounts-0.1.1.tar.gz", "has_sig": false, "md5_digest": "14c853d14b293f1b40c2763757b1a813", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3792, "upload_time": "2018-08-11T09:50:10", "url": "https://files.pythonhosted.org/packages/e9/c8/dba0f137b8fde29884d0e81381c2b39d4fd0a533d8399b13f8c298b0e4b9/oauth-slave-accounts-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "14c853d14b293f1b40c2763757b1a813", "sha256": "c0361fa155935f94b286eac526b2b0ddad8ca5a5416a0246209595716150d924" }, "downloads": -1, "filename": "oauth-slave-accounts-0.1.1.tar.gz", "has_sig": false, "md5_digest": "14c853d14b293f1b40c2763757b1a813", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3792, "upload_time": "2018-08-11T09:50:10", "url": "https://files.pythonhosted.org/packages/e9/c8/dba0f137b8fde29884d0e81381c2b39d4fd0a533d8399b13f8c298b0e4b9/oauth-slave-accounts-0.1.1.tar.gz" } ] }