{"id":25553090,"url":"https://github.com/KERELKO/auth-service","last_synced_at":"2026-02-18T03:30:15.460Z","repository":{"id":278234075,"uuid":"897752076","full_name":"KERELKO/advanced-auth-service","owner":"KERELKO","description":"Auth service with MFA, token-based access, OAuth2.0 and permission management","archived":false,"fork":false,"pushed_at":"2025-02-18T17:19:16.000Z","size":474,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T18:29:05.956Z","etag":null,"topics":["2fa","authentication","authorization","mfa","oauth2","postgres","pytest","redis","sqlalchemy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"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/KERELKO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-03T07:13:02.000Z","updated_at":"2025-02-18T17:19:19.000Z","dependencies_parsed_at":"2025-02-18T18:39:50.779Z","dependency_job_id":null,"html_url":"https://github.com/KERELKO/advanced-auth-service","commit_stats":null,"previous_names":["kerelko/advanced-auth-service"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KERELKO%2Fadvanced-auth-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KERELKO%2Fadvanced-auth-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KERELKO%2Fadvanced-auth-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KERELKO%2Fadvanced-auth-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KERELKO","download_url":"https://codeload.github.com/KERELKO/advanced-auth-service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239832035,"owners_count":19704544,"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":["2fa","authentication","authorization","mfa","oauth2","postgres","pytest","redis","sqlalchemy"],"created_at":"2025-02-20T11:42:30.539Z","updated_at":"2026-02-18T03:30:15.403Z","avatar_url":"https://github.com/KERELKO.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advanced Auth Service\n\n## Overview\nAdvanced Auth Service is a authentication solution offering features such as Multi-Factor Authentication (MFA), permission management, and token-based access. It supports user login, registration, and secure access to applications.\n\n## Features\n- **User Authentication**: Login and Registration functionalities.\n- **Access \u0026 Refresh Tokens**: Secure token-based authentication.\n- **Multi-Factor Authentication (MFA)**: Supports OTP and email-based verification codes.\n- **Permission Logic**: Granular control over user permissions.\n\n## Technologies\n- Docker \u0026 Docker compose\n- Redis\n- PostgreSQL\n- SQLAlchemy\n\n## Getting Started\n\n### Prerequisites\nEnsure you have the following installed:\n- Docker \u0026 Docker Compose\n- Git\n- Maketools\n\n### Setup and Run\n1. Clone the Repository  \n```bash\ngit clone https://github.com/KERELKO/advanced-auth-service\ncd advanced-auth-service/\n```\n2. Create __.env__ file based on __.env.example__\n```bash\ncat .env.example \u003e .env\n```\n3. Build and run docker containers\n```bash\ndocker compose up --build\n```\n\n### Usage\n\n#### MFA\nOTP MFA requires any authenticator (e.g. Google Authenticator).  \nTo pass MFA with email code you need to set `APP_EMAIL_ADDRESS` in `.env` file (You can use your own google email)\nBut to make it work you need to turn on `2-Step Verification`, [create password for the app](https://security.google.com/settings/security/apppasswords) and paste this password to `APP_EMAIL_PASSWORD` in `.env` file\n\n#### OAuth2.0\nTo test __OAuth2.0__ you need to register the app in **Github** or **Google** and have public https url that can serve as `redirect_uri` for the OAuth2.0 provider.  \n[Google OAuth2.0 documentation](https://support.google.com/cloud/answer/6158849?hl=en)  \n[GitHub OAuth2.0 documentation](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps)  \nAfter registering the application with your chosen service, you will receive a `Client ID` and `Client secret`. Copy these values and add them to `.env` file\n```\nGOOGLE_CLIENT_ID=google_client_id\nGOOGLE_CLIENT_SECRET=google_client_secret\n\nGITHUB_CLIENT_ID=github_client_id\nGITHUB_CLIENT_SECRET=github_client_secret\n```\nInstall [tunnelmole](https://tunnelmole.com/) and run with\n```\ntmole 8000\n```\nYou will see public __http__ and __https__ urls\ntake the __https__ url and paste it to `OAUTH_REDIRECT_URI` in `.env` file with `/oauth/callback` suffix\n\nRun the application\n```\ndocker compose up\n```\nIn the Browser enter url __`tmole_https_url`/oauth/login?provider=(google or github)__ and pass the OAuth2.0 flow\n\n#### Testing\nAt the moment app does not expose web API,\nand can be tested only with pytest or mock FastAPI endpoints for OAuth2.0\n\nAll implemented features tested in `tests` folder.  \nRun all tests (Including expected input from the user)\n```\nmake tests\n```\nRun auto tests\n```\nmake auto-tests\n```\nIf you want to run specific test\n```\nmake shell\npytest tests/.../test_you_want_to_run.py\n# MFA tests with OTP \npytest tests/usecases/interactive/test_mfa_with_otp.py\n# MFA tests with email code\npytest tests/usecases/interactive/test_mfa_with_email_code.py\n```\nInspect all available __Make__ commands in `Makefile` file  \n\n## Future Improvements\n1. Implement MFA with __Security Token__, __Fingerprint__\n2. Implement use cases for:\n    - Reset password\n    - Forgot password\n3. Application OAuth2.0 interface\n4. Integrate __roles__ to __permissions__ logic\n5. Extend notification services with __PushNotificationService__\n6. FastAPI endpoints for use cases\n7. Add email verification\n8. Celery for notification services\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKERELKO%2Fauth-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKERELKO%2Fauth-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKERELKO%2Fauth-service/lists"}