https://github.com/wpcodevo/two_factor_golang
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.
https://github.com/wpcodevo/two_factor_golang
2fa-golang 2factor crud-api golang golangapi otp otp-golang otp-verification totp totp-tokens
Last synced: 16 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/wpcodevo/two_factor_golang
- Owner: wpcodevo
- Created: 2022-09-29T14:42:27.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-13T14:28:22.000Z (over 2 years ago)
- Last Synced: 2025-03-27T09:11:34.338Z (about 1 month ago)
- Topics: 2fa-golang, 2factor, crud-api, golang, golangapi, otp, otp-golang, otp-verification, totp, totp-tokens
- Language: Go
- Homepage: https://codevoweb.com/two-factor-authentication-2fa-in-golang
- Size: 17.6 KB
- Stars: 39
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How to Implement (2FA) Two-factor Authentication in Golang
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.
## Topics Covered
- What is Two-Factor Authentication (2FA)
- Run the Golang 2FA App Locally
- Run the 2FA Frontend Built with React.js
- Two-factor Authentication in Golang Overview
- Setup the 2FA feature
- Generate the QR Code
- Enable the 2FA feature
- Validate the TOTP token
- Disable the 2FA Feature
- Setup the Golang Project
- Create the Database Model with GORM
- Create the Golang Route Handlers
- Register User Handler
- Login User Handler
- Generate the TOTP token
- Verify the TOTP token
- Validate the TOTP token
- Disable the TOTP Feature
- Create the Gin Gonic API Routes
- Add Routes to Gin Gonic MiddlewareRead the entire article here: [https://codevoweb.com/two-factor-authentication-2fa-in-golang](https://codevoweb.com/two-factor-authentication-2fa-in-golang)
Related articles:
1. [How to Implement Two-factor Authentication (2FA) in React.js](https://codevoweb.com/two-factor-authentication-2fa-in-reactjs)
2. [Two-factor Authentication (2FA) in FastAPI and Python](https://codevoweb.com/two-factor-authentication-2fa-in-fastapi-and-python)
3. [How to Implement (2FA) Two-factor Authentication in Node.js](https://codevoweb.com/two-factor-authentication-2fa-in-nodejs)