https://github.com/wpcodevo/totp-rust
In this comprehensive guide, you'll learn how to implement two-factor authentication (2FA) in a Rust application using OTP tokens generated by an Authenticator app like Authy, Google Authenticator, or Chrome's Authenticator extension.
https://github.com/wpcodevo/totp-rust
actix-web otp otp-token otp-verification rust rust-api rustlang totp totp-rs totp-tokens two-factor-auth two-factor-authentication
Last synced: 8 months ago
JSON representation
In this comprehensive guide, you'll learn how to implement two-factor authentication (2FA) in a Rust application using OTP tokens generated by an Authenticator app like Authy, Google Authenticator, or Chrome's Authenticator extension.
- Host: GitHub
- URL: https://github.com/wpcodevo/totp-rust
- Owner: wpcodevo
- Created: 2023-01-14T13:44:16.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-27T13:21:50.000Z (almost 2 years ago)
- Last Synced: 2025-03-27T09:11:34.497Z (9 months ago)
- Topics: actix-web, otp, otp-token, otp-verification, rust, rust-api, rustlang, totp, totp-rs, totp-tokens, two-factor-auth, two-factor-authentication
- Language: Rust
- Homepage: https://codevoweb.com/rust-implement-2fa-two-factor-authentication/
- Size: 18.6 KB
- Stars: 35
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust - Implement (2FA) Two-Factor Authentication
In this comprehensive guide, you'll learn how to implement two-factor authentication (2FA) in a Rust application using OTP tokens generated by an Authenticator app like Authy, Google Authenticator, or Chrome's Authenticator extension.

## Topics Covered
- Run the Rust 2FA Project Locally
- Run the Rust 2FA Project with a React.js App
- Initialize the Rust Project
- Setup an In-memory Database
- Create Response Structs
- Implement the Two-Factor Authentication
- Register New User
- Login User
- Generate the TOTP Credentials
- Verify the TOTP Token
- Validate the TOTP Token
- Disable the 2FA Feature
- Merge the 2FA API Routes
- Add CORS to the API Server
- Test the Two-Factor Authentication Flow
- Create an Account
- Sign into the Account
- Generate the 2FA QRCode
- Verify the OTP Token
- Validate the OTP Token
- Disable the Two-Factor Authentication
- Importance of Adding 2FA to a Rust App
Read the entire article here: [https://codevoweb.com/rust-implement-2fa-two-factor-authentication/](https://codevoweb.com/rust-implement-2fa-two-factor-authentication/)