Simple web API for authorizing and authenticating users created with .NET, PostgreSQL with Docker support.
This repository is a part of something bigger, the FoodTrans project. Module presented here is responsible for everything related to authorization and authentication. It uses JWT access tokens and refresh tokens.
We extracted the smallest possible part of our project to make this module generic. It can be used as starting point for any other application, that needs authorization and authentication.
Project is built with:
- .NET - .NET is a free, cross-platform, open source developer platform for building many different types of applications. With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, games, IoT, and more.
- PostgreSQL - PostgreSQL is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
There are two ways to run this project. You can run it in dockerized conatiner or localy with .NET runtime. After cloning the repository you can:
First, make sure you have docker installed. If yes, then open your terminal and go to root folder of this repository. Then you can build the dockerfile using command:
docker build -t foodtrans.auth:latest .
If build succedded, you can run the image with:
docker run -d -p <port>:80 foodtrans.auth:latest
Open your browser and go under the address http://localhost:8080
to communicate with the API.
To run this project, you need to have .NET SDK installed. If you don't have, go under this link and download appropriate SKD for your operating system. Next, open terminal and go under root folder of this repository. Run project with command:
dotnet run
- Authenticating users
- Allowing to authorize with JWT Token
If you found a bug, go ahead and open issue by providing detailed description, so we could reproduce the bug and fix it.