Explore the world of HTTP communication, authentication, and resource access through this Python-based simulation project. Simulate the interaction between a client, an Authorization Server, and a Resource API, gaining hands-on insights into the process of securing and retrieving data.
This is a Python project that simulates HTTP communication between a client, an Authorization Server, and a Resource API.
Follow these steps to set up and execute the project:
-
Clone the GitHub Repository:
Clone the project repository from GitHub.
-
Ensure You Have Python Interpreter or venv:
Make sure you have a Python interpreter installed, or create a virtual environment (venv) with Python.
-
Install Required Packages:
Install the required packages by running the following command:
pip install -r requirements.txt
To execute the project, activate all three components one by one:
- Open Three Terminals:
Open three separate terminal windows.
Terminal 1: Run the Authorization Server:
python authorization_server.py
Terminal 2: Run the Resource API:
python resource_api.py
Terminal 3: Run the Client Simulation:
python main.py
The output should resemble the following:
- Execute Unit Test Cases:
After successful execution of the scripts, you can run the unit test cases using the following command:
python -m unittest test_server_interactions.py
In case you encounter errors related to ports already in use while executing scripts, you can kill the processes running on the ports