Skip to content

Repository files navigation

🔑 SecurePassless - A Flask-Based Passwordless Authentication System

A modern, secure, and user-friendly passwordless authentication system built with Python and Flask. This project eliminates the need for traditional passwords by implementing a "magic link" login flow, enhancing both security and user experience.

online URL using ngrok (only works if the server is active )

https://unseraphically-nonchalky-hermila.ngrok-free.dev/register

✨ Overview

Traditional password-based systems are prone to various security risks, including phishing, credential stuffing, and data breaches. SecurePassless tackles this problem by allowing users to log in using a secure, one-time link sent to their email address. This approach is not only more secure but also removes the friction of remembering complex passwords.

This project was developed with a focus on clean code, security best practices, and ease of integration.


🚀 Key Features

  • Password-Free Login: Users sign in with their email, receiving a unique, time-sensitive magic link.
  • Secure Token Generation: Utilizes cryptographically secure tokens (JWTs) for authentication links.
  • Flask Backend: Built on a lightweight and powerful Python web framework.
  • Responsive Frontend: A clean and simple user interface built with HTML, CSS, and vanilla JavaScript.
  • Environment-Based Configuration: Easily manage secret keys and email settings using environment variables.
  • Scalable Structure: Organized project structure that is easy to understand and extend.

🛠️ Tech Stack

  • Backend: Python, Flask
  • Frontend: HTML, CSS, JavaScript
  • Database: SQLite (can be easily swapped for PostgreSQL, etc.)
  • Email: SMTP (using Python's smtplib or Flask-Mail)

📁 Project Structure

Here is a recommended project structure that promotes scalability and organization.

securepassless/
├── app/                    # Main application package       
│   ├── models.py           # Database models (e.g., User model)
│   ├── routes.py           # Defines URL routes and view functions
│   ├── static/             # Static assets
│   │   ├── css/style.css
│   │   └── js/main.js
│   └── templates/          # HTML templates
│       ├── dashboard.html
│       ├── login.html
|       |── register.html
|       |── index.html
|       |── qr_display.html
|       |── qr_login.html
│
├── venv/                   # Python virtual environment folder
├── .env                    # Environment variables for configuration
├── .gitignore              # Specifies files for Git to ignore
├── config.py               # Configuration file
├── requirements.txt        # Project dependencies
├── app.py                  # Entry point to run the application
└── README.md               # This file



⚙️ project architecture

Screenshot of the SecurePassless login page!

⚙️ Getting Started

Follow these instructions to get a local copy up and running for development and testing purposes.

Prerequisites

  • Python 3.8+
  • pip package manager
  • A functioning SMTP server or an email service provider (like Gmail, SendGrid, etc.) to send magic links.

📖 How It Works

  1. Enter Email: The user navigates to the login page and enters their registered email address.
  2. Generate & Send Link: The backend validates the email, generates a secure, short-lived JSON Web Token (JWT), and emails a "magic link" containing this token to the user.
  3. Authenticate: The user clicks the link in their email. The application receives the request, validates the token (checking its signature and expiration), and if valid, establishes a session for the user, logging them in.
  4. Access Granted: The user is redirected to their dashboard or the main application page as an authenticated user.

About

A modern Flask-based passwordless authentication system that enables secure login through magic links and JWT-based verification, eliminating traditional passwords while improving security and user experience.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages