Giter VIP home page Giter VIP logo

ujjs / 2faapp-two-factor-authentication- Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 3.54 MB

This Node.js and Express app demonstrates Two-Factor Authentication (2FA) with Speakeasy and MongoDB. Users register, receive a unique QR code for 2FA setup, and verify using the generated one-time password (OTP).

HTML 42.22% JavaScript 57.78%
authentication-backend css express html javascript mongodb-atlas nodejs

2faapp-two-factor-authentication-'s Introduction

2FA (Two-Factor Authentication) Application

This is a simple Node.js and Express application that demonstrates two-factor authentication (2FA) using Speakeasy, MongoDB for user storage, and QR codes for setup.

Prerequisites

Before running the application, make sure you have the following installed:

Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/2fa-application.git
  2. Install dependencies:

    cd 2fa-application
    npm install
  3. Start the application:

    node index.js

    The server will be running on http://localhost:3000.

Usage

  1. Open your browser and go to http://localhost:3000.
  2. Fill in the registration form to register a new user. The server will provide a QR code for 2FA setup.
  3. Use an authenticator app (e.g., Google Authenticator) to scan the QR code and generate OTPs.
  4. Fill in the verification form with your username and the OTP generated by the authenticator app to verify.

Important Notes

  • This is a basic example for sample backend purposes. In a production environment, additional security measures and considerations should be implemented.

  • Make sure to secure your MongoDB connection and handle errors more gracefully in a real-world scenario.

  • The application is configured to connect to a MongoDB database named 2fa-example. Adjust the connection URI in index.js if needed.

License

This project is licensed under the MIT License - see the LICENSE file for details.

2faapp-two-factor-authentication-'s People

Contributors

ujjs avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.