This repository contains a robust and scalable example of an authentication microservice using JWT in .NET 6
- Identity
- Authenticate a user
- Refresh token
- Register
- Create a new user
- Password recovery
- Request change passoword verification code
- Confirm verification code
- Change password with verification
- User
- Get authenticated user
- User update
- Verification
- Verify phone number
- Verify email
Inside the src folder, exec docker compose
docker compose-up
1 - Go to the directory where the test project is.
cd src\Sample.Identity.Tests
2 - Execute the following command.
dotnet test
-
Currently, there is no officially implemented Microsoft Identity for MongoDB, only a third-party library. As authentication is the core of the project, it was decided not to rely on these libraries.
-
Sendgrid was chosen to send emails because the platform offers 100 free emails a day, in addition to being extremely cheap on paid plans and the possibility of using dynamic templates.
-
For sending sms, the Zenvia platform was chosen
The project has integration with the Kibana analytical tool, you can view the logs through the container that is started when performing the compose-up
The project architecture is based on some concepts of DDD and onion architecture, many of the concepts applied here you can find references in microsoft's own documentation.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.