{"id":21800968,"url":"https://github.com/wpcodevo/totp-rust","last_synced_at":"2025-04-13T18:23:21.966Z","repository":{"id":121164947,"uuid":"588922311","full_name":"wpcodevo/totp-rust","owner":"wpcodevo","description":"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.","archived":false,"fork":false,"pushed_at":"2023-12-27T13:21:50.000Z","size":19,"stargazers_count":35,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T09:11:34.497Z","etag":null,"topics":["actix-web","otp","otp-token","otp-verification","rust","rust-api","rustlang","totp","totp-rs","totp-tokens","two-factor-auth","two-factor-authentication"],"latest_commit_sha":null,"homepage":"https://codevoweb.com/rust-implement-2fa-two-factor-authentication/","language":"Rust","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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-01-14T13:44:16.000Z","updated_at":"2025-03-22T00:23:28.000Z","dependencies_parsed_at":"2023-12-27T14:30:20.334Z","dependency_job_id":"ba090cfd-1f3a-47db-8f4c-63d65d1c4685","html_url":"https://github.com/wpcodevo/totp-rust","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%2Ftotp-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Ftotp-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Ftotp-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Ftotp-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpcodevo","download_url":"https://codeload.github.com/wpcodevo/totp-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248759141,"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":["actix-web","otp","otp-token","otp-verification","rust","rust-api","rustlang","totp","totp-rs","totp-tokens","two-factor-auth","two-factor-authentication"],"created_at":"2024-11-27T11:15:25.597Z","updated_at":"2025-04-13T18:23:21.932Z","avatar_url":"https://github.com/wpcodevo.png","language":"Rust","readme":"# Rust - Implement (2FA) Two-Factor Authentication\n\nIn 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.\n\n![Rust - Implement (2FA) Two-Factor Authentication](https://codevoweb.com/wp-content/uploads/2023/01/Rust-Implement-2FA-Two-Factor-Authentication.webp)\n\n## Topics Covered\n\n- Run the Rust 2FA Project Locally\n- Run the Rust 2FA Project with a React.js App\n- Initialize the Rust Project\n- Setup an In-memory Database\n- Create Response Structs\n- Implement the Two-Factor Authentication\n    - Register New User\n    - Login User\n    - Generate the TOTP Credentials\n    - Verify the TOTP Token\n    - Validate the TOTP Token\n    - Disable the 2FA Feature\n    - Merge the 2FA API Routes\n- Add CORS to the API Server\n- Test the Two-Factor Authentication Flow\n    - Create an Account\n    - Sign into the Account\n    - Generate the 2FA QRCode\n    - Verify the OTP Token\n    - Validate the OTP Token\n    - Disable the Two-Factor Authentication\n- Importance of Adding 2FA to a Rust App\n\nRead the entire article here: [https://codevoweb.com/rust-implement-2fa-two-factor-authentication/](https://codevoweb.com/rust-implement-2fa-two-factor-authentication/)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpcodevo%2Ftotp-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpcodevo%2Ftotp-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpcodevo%2Ftotp-rust/lists"}