This is a simple example of implementing token-based authentication in a FastAPI application.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To run this project, you need Python installed on your machine. You can download it from python.org.
-
Clone the repository to your local machine:
git clone https://github.com/AbinandhMJ/FastAPI-TokenAuthenticator-API.git
-
Navigate into the project directory:
cd FastAPI-TokenAuthenticator-API
-
Install the required dependencies:
pip install -r requirements.txt
To run the FastAPI application, execute the following command:
uvicorn main:app --reload
The API will start running at http://localhost:8000
.
Testing Port will be http://localhost:8000/docs
/token
: Issue an access token by providing valid credentials./users/me/
: Get information about the currently authenticated user./users/me/items
: Get items belonging to the currently authenticated user.
- FastAPI - FastAPI framework for building APIs with Python 3.7+.
- Pydantic - Data validation and settings management using Python type annotations.
- Passlib - Password hashing library.
- JWT - JSON Web Tokens for token-based authentication.
- Abinandh MJ - Initial work
This project is licensed under the MIT License - see the LICENSE file for details.
- Hat tip to anyone whose code was used
- Inspiration
- etc.