Skip to content

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

Notifications You must be signed in to change notification settings

AbinandhMJ/FastAPI-TokenAuthenticator-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages