Single-sign on flask web application
Find a file
2024-02-25 09:10:55 +00:00
templates Add option to logout 2024-01-21 15:24:33 +00:00
UniAuth Add support for web app unprivileged view 2024-02-25 09:10:55 +00:00
.gitignore Initial commit 2024-01-21 09:10:07 +00:00
LICENSE Initial commit 2024-01-21 09:10:07 +00:00
main.py Rename cookie and refactor code 2024-02-19 09:45:17 +00:00
README.md Initial commit 2024-01-21 09:10:07 +00:00

UniAuth

UniAuth is a single sign-on application designed to provide a secure and efficient method for managing user authentication. The application is built using Flask, a popular web framework in Python, and offers a straightforward implementation suitable for integrating into various web services.

Features

  • Token-Based Authentication: Generates and verifies secure authentication tokens.
  • Login Required Decorator: Enhances routes to require user authentication.
  • User Authentication: Validates username and password against stored credentials.
  • Secure Cookie Handling: Sets authentication tokens in cookies with security best practices.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Python 3
  • Flask
  • Werkzeug
  • ItsDangerous

Installing

  1. Clone the repository:
    git clone https://git.4angle.com/edward/UniAuth
    
  2. Install the required packages:
    pip install flask werkzeug itsdangerous
    
  3. Set up the configuration in config/default.py.

Running the Application

Run the application using:

python main.py

The application should now be running on http://0.0.0.0:5000/.

Usage

  • Login: Users can log in by providing their username and password.
  • Token Generation: Upon successful login, a secure token is generated and stored in a cookie.
  • Access Protected Routes: Only authenticated users can access protected routes.

Contributing

Contributions are welcome. If you'd like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them with descriptive messages.
  4. Push your changes to your fork.
  5. Create a pull request to the main repository's main branch.

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute it as per the license terms. See the LICENSE file for details.

Acknowledgments

  • Flask team for the great web framework
  • ItsDangerous for secure token generation

This README provides a basic overview and guide for your application. You can further customize it to include more detailed documentation as needed.