Skip to content

In this,we use authentication process and also authorization process by using concept of Python,MongoDB and FastAPI

Notifications You must be signed in to change notification settings

Gauravkr07/Authentication-Assignment-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Authentication-Assignment-

Aim:

  Authentication system in endpoint of FastAPI .

Requirements:

  • python3
  • pip
  • FastAPI
  • Uvicorn server
  • python libraries:
    • Pydantic
    • pymongo
    • passlib.context
    • fastapi.security
    • config module(containing environment variable)
    • jose
    • datetime
  • MongoDB
  • git

To run the application on your local machine:

1. Clone the repository:

    git clone "https://github.com/Gauravkr02/Authentication-Assignment-"

2. Change the directory into the repository:

    cd ./`Authentication-Assignment-'

3. Create python virtual environment

    python3 -m venv ./ver_env

4. Install python requirements:

    pip install -r requirements.txt

5. To execute, Open the pycharm application

  • Run the main.py (We need uvicorn server to run Fastapi and need to use localhost ip with portnumber.)

    • To run this we have two mathod:-
        1. configure run by importing module uvicorn)
        1. use uvicorn comman (uvicorn main:app --reaload)
  • Check 127.0.0.1/docs by using any system browser

  • when you visit this address then you find padlock sign in corner(represent that it's locked).

6. Sign_UP At this endpint

   + where we can store data(username(in email format) and password for sign_in into MongoDB.
   + username  are in email format and password received in plain form but password stored in hash format.

7. sign_in At this endpoint

   + at first you have to enter username 
   + if username found then you have to enter password
   + Then authenticate function match username with password
   + if matched then it generate jwt token otherwise raise error.

About

In this,we use authentication process and also authorization process by using concept of Python,MongoDB and FastAPI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages