{"id":21800953,"url":"https://github.com/wpcodevo/two_factor_golang","last_synced_at":"2025-04-13T18:23:34.095Z","repository":{"id":62867667,"uuid":"543173492","full_name":"wpcodevo/two_factor_golang","owner":"wpcodevo","description":"This article will teach you how to secure a Golang API by implementing two-factor authentication (2FA) using TOTP codes generated by an authenticator app like Google Authenticator or Authy.","archived":false,"fork":false,"pushed_at":"2022-10-13T14:28:22.000Z","size":18,"stargazers_count":39,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T09:11:34.338Z","etag":null,"topics":["2fa-golang","2factor","crud-api","golang","golangapi","otp","otp-golang","otp-verification","totp","totp-tokens"],"latest_commit_sha":null,"homepage":"https://codevoweb.com/two-factor-authentication-2fa-in-golang","language":"Go","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/wpcodevo.png","metadata":{"files":{"readme":"README.md","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":"2022-09-29T14:42:27.000Z","updated_at":"2025-03-24T21:53:12.000Z","dependencies_parsed_at":"2022-11-08T06:49:43.650Z","dependency_job_id":null,"html_url":"https://github.com/wpcodevo/two_factor_golang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Ftwo_factor_golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Ftwo_factor_golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Ftwo_factor_golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Ftwo_factor_golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpcodevo","download_url":"https://codeload.github.com/wpcodevo/two_factor_golang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248759149,"owners_count":21157098,"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-golang","2factor","crud-api","golang","golangapi","otp","otp-golang","otp-verification","totp","totp-tokens"],"created_at":"2024-11-27T11:15:21.567Z","updated_at":"2025-04-13T18:23:34.073Z","avatar_url":"https://github.com/wpcodevo.png","language":"Go","readme":"# How to Implement (2FA) Two-factor Authentication in Golang\n\nThis article will teach you how to secure a Golang API by implementing two-factor authentication (2FA) \nusing TOTP codes generated by an authenticator app like Google Authenticator or Authy.\n\n![How to Implement (2FA) Two-factor Authentication in Golang](https://codevoweb.com/wp-content/uploads/2022/10/How-to-Implement-Two-factor-Authentication-2FA-in-Golang.webp)\n\n## Topics Covered\n\n- What is Two-Factor Authentication (2FA)\n- Run the Golang 2FA App Locally\n- Run the 2FA Frontend Built with React.js\n- Two-factor Authentication in Golang Overview\n    - Setup the 2FA feature\n    - Generate the QR Code\n    - Enable the 2FA feature\n    - Validate the TOTP token\n    - Disable the 2FA Feature\n- Setup the Golang Project\n- Create the Database Model with GORM\n- Create the Golang Route Handlers\n    - Register User Handler\n    - Login User Handler\n    - Generate the TOTP token\n    - Verify the TOTP token\n    - Validate the TOTP token\n    - Disable the TOTP Feature\n- Create the Gin Gonic API Routes\n- Add Routes to Gin Gonic Middleware\n\n\nRead the entire article here: [https://codevoweb.com/two-factor-authentication-2fa-in-golang](https://codevoweb.com/two-factor-authentication-2fa-in-golang)\n\nRelated articles:\n\n1. [How to Implement Two-factor Authentication (2FA) in React.js](https://codevoweb.com/two-factor-authentication-2fa-in-reactjs)\n2. [Two-factor Authentication (2FA) in FastAPI and Python](https://codevoweb.com/two-factor-authentication-2fa-in-fastapi-and-python)\n3. [How to Implement (2FA) Two-factor Authentication in Node.js](https://codevoweb.com/two-factor-authentication-2fa-in-nodejs)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpcodevo%2Ftwo_factor_golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpcodevo%2Ftwo_factor_golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpcodevo%2Ftwo_factor_golang/lists"}