Authentication system in endpoint of FastAPI .
- python3
- pip
- FastAPI
- Uvicorn server
- python libraries:
- Pydantic
- pymongo
- passlib.context
- fastapi.security
- config module(containing environment variable)
- jose
- datetime
- MongoDB
- git
git clone "https://github.com/Gauravkr02/Authentication-Assignment-"
cd ./`Authentication-Assignment-'
python3 -m venv ./ver_env
pip install -r requirements.txt
-
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:-
-
- configure run by importing module uvicorn)
-
- use uvicorn comman (uvicorn main:app --reaload)
-
- To run this we have two mathod:-
-
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).
+ 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.
+ 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.