Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Two-Factor Authentication (2FA) with Authenticator App Support in Blazor WebAssembly #26

Merged
merged 5 commits into from
Dec 28, 2024

Conversation

neozhu
Copy link
Owner

@neozhu neozhu commented Dec 26, 2024

Everything Is AWESOME

Summary

This pull request introduces the implementation of Two-Factor Authentication (2FA) in the Blazor WebAssembly application, leveraging authenticator apps such as Google Authenticator or Microsoft Authenticator. The changes enhance security by requiring an additional layer of verification for user authentication.


Key Features

  1. Enable 2FA for Users:

    • Backend generates a TOTP secret (authenticatorKey) and returns a QR code URI.
    • Frontend displays the QR code for users to scan with their authenticator app.
  2. Verify 2FA Setup:

    • Users verify the 2FA setup by entering a code generated by their authenticator app.
    • Successful verification enables 2FA for the user's account.
  3. Login with 2FA:

    • If 2FA is enabled, users are prompted to enter their 2FA code during login.
    • Supports both TOTP codes and recovery codes for flexible authentication.
  4. Improved User Feedback:

    • Snackbar notifications are used to provide clear feedback for both successful and failed operations.
    • Example feedback includes "Two-factor authentication enabled successfully" and "Invalid verification code."

@neozhu
Copy link
Owner Author

neozhu commented Dec 28, 2024

image

@neozhu
Copy link
Owner Author

neozhu commented Dec 28, 2024

add GenerateRecoveryCodes

@neozhu neozhu merged commit 33bb6dd into main Dec 28, 2024
4 checks passed
@neozhu neozhu deleted the feature/totpauthenticatorapp branch December 28, 2024 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant