Giter VIP home page Giter VIP logo

basicauthentication's Introduction

Flask User Authentication and Authorization

This Flask appn demonstrates user authentication and authorization using various methods such as Basic Auth, Bearer Token and bcrpyt for password hashing.

Project Overview

This project showcases user authentication and authorization features implemented in a Flask application. It includes functionalities for user sign-up, login, and access control to protected routes.

Installation and Setup

  1. Clone the Repository:
    git clone https://github.com/VineetDabholkar2002.git
  2. Navigate to the Project Directory:
    cd App
  3. Install Dependencies:
    pip install -r requirements.txt
  4. Run the Application:
    python BasicAuth.py
  5. Access the Application: Open your web browser and navigate to http://localhost:8080.

File Structure

  • app.py: Contains the Flask application logic, routes, and authentication functionalities.
  • templates/: Directory containing HTML templates for login, signup, and main pages.
  • users.json: File storing user information, including hashed passwords and salts.

Usage

  1. Sign Up:

    • Visit /signup to create a new account with a unique username and password.
  2. Login:

    • Use /login to log in using Basic Auth.\
  3. Protected Route:

    • Access /main after successful login to view protected content (in this case you will be routed to Google.com. Unauthorized access will display an error message.
  4. Authentication Tokens:

    • Bearer Tokens are generated and verified for user authentication during login. Also they can be set to expire after a certain period of time

Bcrypt

image

This application utilizes bcrypt for secure password hashing and storage:

What is bcrypt?

  • bcrypt is a password-hashing function designed to securely hash passwords for storage.
  • It employs a strong one-way hashing algorithm, making it computationally intensive and thereby resistant to brute-force attacks.

How does bcrypt work?

  • It generates a salted hash of the password, making each hash unique and preventing rainbow table attacks.
  • The computational intensity helps mitigate password cracking attempts by slowing down the hashing process.

Why use bcrypt?

  • Bcrypt's resistance to brute-force attacks and its adaptive nature (allowing for increasing computational complexity over time) make it a preferred choice for secure password hashing.

basicauthentication's People

Contributors

vineetdabholkar2002 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.