{"id":13815198,"url":"https://github.com/codemation/easyauth","last_synced_at":"2025-05-16T00:00:27.768Z","repository":{"id":40654946,"uuid":"332430829","full_name":"codemation/easyauth","owner":"codemation","description":"Create a centralized Authentication and Authorization token server. Easily secure FastAPI endpoints based on Users, Groups, Roles or Permissions with very little database usage.","archived":false,"fork":false,"pushed_at":"2024-06-11T19:11:08.000Z","size":3786,"stargazers_count":616,"open_issues_count":14,"forks_count":55,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-09T23:05:57.756Z","etag":null,"topics":["admin-dashboard","authentication","authorization","fastapi","gui","jwt","permissions","rbac","user-management"],"latest_commit_sha":null,"homepage":"https://easyauth.readthedocs.io/en/latest/","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codemation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.MD","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-24T11:22:31.000Z","updated_at":"2025-05-02T20:42:32.000Z","dependencies_parsed_at":"2024-08-04T04:07:21.782Z","dependency_job_id":"093d4be9-2762-49ef-b5e0-ab2763fe94de","html_url":"https://github.com/codemation/easyauth","commit_stats":{"total_commits":207,"total_committers":7,"mean_commits":"29.571428571428573","dds":0.6183574879227054,"last_synced_commit":"e8e8aa0ee9ad6f6ce9ff488c6b9fe2607d71b9fc"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemation%2Feasyauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemation%2Feasyauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemation%2Feasyauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemation%2Feasyauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemation","download_url":"https://codeload.github.com/codemation/easyauth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071877,"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","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":["admin-dashboard","authentication","authorization","fastapi","gui","jwt","permissions","rbac","user-management"],"created_at":"2024-08-04T04:03:07.353Z","updated_at":"2025-05-16T00:00:27.493Z","avatar_url":"https://github.com/codemation.png","language":"Python","readme":"![](./images/logo_t.png)\n\u003cbr\u003e\n\n---\n\nCreate a centralized Authentication and Authorization token server. Easily secure FastAPI endpoints based on Users, Groups, Roles or Permissions to minimize database access requirements of Auth.\n\n[![Documentation Status](https://readthedocs.org/projects/easyauth/badge/?version=latest)](https://easyauth.readthedocs.io/en/latest/?badge=latest) [![PyPI version](https://badge.fury.io/py/easy-auth.svg)](https://pypi.org/project/easy-auth/)\n\n\u003ch2\u003eDocumentation\u003c/h1\u003e\n\n[https://easyauth.readthedocs.io/en/latest/](https://easyauth.readthedocs.io/en/latest/)\n\n## Key Features\n\n- Centralized Auth - Single location for Users \u0026 Permissions to share across apps\n- Granular Endpoint Security - Verify user identity, and define explicitly who and what each user or groups of users may access\n- Admin GUI - easy management of users, permissions, tokens, oauth and more!\n- Advanced JWT - Token Based Client authorization with built in invalidation capabilities\n- Google Oauth - Easy to configure google login\n- Integrated Login \u0026 Cookie Management - Users are not just authenticated and authorized, they are re-directed on token expiration to login pages via cookie system and sent back to last location afterwards\n\n## Quick Start\n\n```bash\n\n$ virtualenv -p \u003cpython3.X\u003e easy-auth-env\n$ source easy-auth-env/bin/activate\n\n(easy-auth) $ pip install easy-auth[server]\n\n(easy-auth) $ pip install easy-auth[client] # without db\n\n```\n\n## Basic Server\n\nConfigure require env variables via a .json\n\n```Bash\n$ cat \u003e server_env.json \u003c\u003cEOF\n{\n    \"DB_TYPE\": \"sqlite\",\n    \"DB_NAME\": \"auth\",\n    \"ISSUER\": \"EasyAuth\",\n    \"SUBJECT\": \"EasyAuthAuth\",\n    \"AUDIENCE\": \"EasyAuthApis\",\n    \"KEY_PATH\": \"/my_key-location\",\n    \"KEY_NAME\": \"test_key\"\n}\nEOF\n```\n\n```python\n#test_server.py\nfrom fastapi import FastAPI\n\nfrom easyauth.server import EasyAuthServer\n\nserver = FastAPI()\n\nserver.auth = EasyAuthServer.create(\n    server,\n    '/auth/token',\n    auth_secret='abcd1234',\n    admin_title='EasyAuth - Company',\n    admin_prefix='/admin',\n    env_from_file='server_env.json'\n)\n\n```\n\nStart Sever\n\n```bash\nuvicorn --host 0.0.0.0 --port 8330 test_server:server\n```\n\n## Basic Client\n\n```python\n#test_client.py\nfrom fastapi import FastAPI\n\nfrom easyauth.client import EasyAuthClient\nfrom easyauth import get_user\n\nserver = FastAPI()\n\nserver.auth = EasyAuthClient.create(\n    server,\n    token_server='0.0.0.0',\n    token_server_port=8090,\n    auth_secret='abcd1234',\n    default_permissions={'groups': ['users']}\n)\n\n# grants access to users matching default_permissions\n@server.auth.get('/default')\nasync def default():\n    return f\"I am default\"\n\n# grants access to only specified users\n@server.auth.get('/', users=['jane'])\nasync def root():\n    return f\"I am root\"\n\n# grants access to members of 'users' or 'admins' group.\n@server.auth.get('/groups', groups=['users', 'admins'])\nasync def groups(user: str = get_user()):\n    return f\"{user} is in groups\"\n\n# grants access to all members of 'users' group\n# or a groups with role of 'basic' or advanced\n@server.auth.get('/roles', roles=['basic', 'advanced'], groups=['users'])\nasync def roles():\n    return f\"Roles and Groups\"\n\n# grants access to all members of groups with a roles granting 'BASIC_CREATE'\n@server.auth.get('/actions', actions=['BASIC_CREATE'])\nasync def action():\n    return f\"I am actions\"\n```\n\n![](docs/images/login.png)\n\n## Server\n\n\u003ch3\u003eSee 0.0.0.0:8330/docs \u003c/h3\u003e\n\n![](docs/images/api/api.png)\n\n### GUI\n\n![](docs/images/admin_gui.png)\n\n## Client\n\n![](images/client.png)\n\n![](images/OAuth.png)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemation%2Feasyauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemation%2Feasyauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemation%2Feasyauth/lists"}