Web application to practice/demonstrate Authentication and Authorization using Flask.
- Implemented user authentication, by creating a user model and storing the user information in a database.
- Ensured user credentialing was correct by hashing (SHA-256) the user's password from the login form and copmparing it to the hashed password stored within the database.
- Added authorization to the application by using the
@login_required
decorator on the profile page, so that only logged-in users could see the profile page.
- Python
- HTML
- CSS
- Flask
- Flask
- SQLAlchemy
- Various built-in Python Modules
Run the below commands in your terminal / command line:
cd ...
git clone https://github.com/malcolmrichardson/authentication-flask-demo.git
cd authentication-flask-demo
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
export FLASK_APP=project
export FLASK_DEBUG=1
flask run
Application runs on http://127.0.0.1:5000 by default. Enjoy and thank you!