{"id":23694517,"url":"https://github.com/jeanribes/oauth-slave-accounts","last_synced_at":"2026-04-12T22:39:08.395Z","repository":{"id":49695304,"uuid":"144370892","full_name":"JeanRibes/oauth-slave-accounts","owner":"JeanRibes","description":"Custom Django Oauth backend for Ressource Servers to download full user data fom Authorization Server","archived":false,"fork":false,"pushed_at":"2022-12-08T02:21:47.000Z","size":7,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-22T11:35:13.889Z","etag":null,"topics":["django","oauth2"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JeanRibes.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-11T09:02:36.000Z","updated_at":"2020-04-21T15:40:47.000Z","dependencies_parsed_at":"2023-01-25T03:31:06.321Z","dependency_job_id":null,"html_url":"https://github.com/JeanRibes/oauth-slave-accounts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JeanRibes/oauth-slave-accounts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeanRibes%2Foauth-slave-accounts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeanRibes%2Foauth-slave-accounts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeanRibes%2Foauth-slave-accounts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeanRibes%2Foauth-slave-accounts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JeanRibes","download_url":"https://codeload.github.com/JeanRibes/oauth-slave-accounts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeanRibes%2Foauth-slave-accounts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272424347,"owners_count":24932893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","oauth2"],"created_at":"2024-12-30T04:26:51.976Z","updated_at":"2026-04-12T22:39:03.344Z","avatar_url":"https://github.com/JeanRibes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"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()","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeanribes%2Foauth-slave-accounts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeanribes%2Foauth-slave-accounts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeanribes%2Foauth-slave-accounts/lists"}