{"id":26985600,"url":"https://github.com/fredimatteo/twofactorauth","last_synced_at":"2026-02-04T03:05:59.560Z","repository":{"id":235155145,"uuid":"789870823","full_name":"fredimatteo/twoFactorAuth","owner":"fredimatteo","description":"A simple project to handle 2FA with google authenticator","archived":false,"fork":false,"pushed_at":"2024-05-17T13:00:20.000Z","size":263,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-07T06:46:17.630Z","etag":null,"topics":["2fa","fastapi","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fredimatteo.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}},"created_at":"2024-04-21T19:20:37.000Z","updated_at":"2025-03-22T15:27:39.000Z","dependencies_parsed_at":"2024-04-22T13:02:37.187Z","dependency_job_id":"0fdc82ea-fc9b-4aa9-9f17-e4df8aaf5e63","html_url":"https://github.com/fredimatteo/twoFactorAuth","commit_stats":null,"previous_names":["fredimatteo/twofactorauth"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fredimatteo/twoFactorAuth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredimatteo%2FtwoFactorAuth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredimatteo%2FtwoFactorAuth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredimatteo%2FtwoFactorAuth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredimatteo%2FtwoFactorAuth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fredimatteo","download_url":"https://codeload.github.com/fredimatteo/twoFactorAuth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredimatteo%2FtwoFactorAuth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29065696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T01:55:38.219Z","status":"online","status_checked_at":"2026-02-04T02:00:07.999Z","response_time":62,"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":["2fa","fastapi","python"],"created_at":"2025-04-03T18:30:07.232Z","updated_at":"2026-02-04T03:05:59.544Z","avatar_url":"https://github.com/fredimatteo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Two-Factor Authentication (2FA) 🛡️\n\n\u003chr\u003e\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Running the App with Docker](#running-the-app-with-docker)\n- [Application Flow](#application-flow)\n\n## Introduction\n\nThis Python project aims to enhance skills and learn new concepts related to Two-Factor Authentication (2FA) implementations. 2FA adds an extra layer of security by requiring not only a password and username but also something that only the user has on them—such as a physical token.\n\n## Running the App with Docker 🐳\n\nTo run the application using Docker, follow these steps:\n\n1. Navigate to the `twoFactorAuth` directory in your terminal.\n2. Execute the command `make docker-up`.\n3. This command will create an instance of PostgreSQL and the application, which will be accessible at `0.0.0.0:8000/`.\n\n## Application Flow\n\nThe application flow of Two-Factor Authentication (2FA) follows these steps:\n\n1. **Create User**: \n   - API POST `/users/create` is used to create a new user. It returns a token to validate the email.\n\n2. **Verify Email**: \n   - API POST `/auth/verify-mail/{token}` is used to validate the email. It returns a JSON containing:\n     - `qrcode_otp`: Base64 encoded QR code to add the user to Google Authenticator.\n     - `code_otp`: Secret to manually enter if a camera cannot be used.\n\n3. **User Login**:\n   - API POST `/auth/login` is used to log in with a username and password. It returns:\n     - `otp_validation_token`: Token to validate the session in the next API call.\n\n4. **Verify OTP**:\n   - API POST `/auth/otp/verify` is used to validate the OTP and return an access token and a refresh token.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredimatteo%2Ftwofactorauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffredimatteo%2Ftwofactorauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredimatteo%2Ftwofactorauth/lists"}