Skip to content

Latest commit

 

History

History
72 lines (44 loc) · 1.99 KB

README.md

File metadata and controls

72 lines (44 loc) · 1.99 KB

FastAPI User Token Authenticator API

FastAPI_b

This is a simple example of implementing token-based authentication in a FastAPI application.

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

To run this project, you need Python installed on your machine. You can download it from python.org.

Installing

  1. Clone the repository to your local machine:

    git clone https://github.com/AbinandhMJ/FastAPI-TokenAuthenticator-API.git
    
  2. Navigate into the project directory:

    cd FastAPI-TokenAuthenticator-API
    
  3. Install the required dependencies:

    pip install -r requirements.txt
    

Running the Application

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

Endpoints

  • /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.

Built With

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

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Hat tip to anyone whose code was used
  • Inspiration
  • etc.