Microservices communication with JWT authorization developed with .Net Core and database connection with Dapper and SQL Server.
- .Net Core 2.2
- JWT Authorization
- Dapper
- SQL Server
- Swagger
- FluentValidation
- AutoMapper
-
Run the script located at "/Docs/script.sql" to create a SQL Server database.
-
In this project, the connection string is set in the APITestRegister's appsettings.json as it follows:
Server=localhost;Database=TestDB;Trusted_Connection=True;
-
Set the Issuer, Audience and Secret of your JWT inside the appsettings.json of both solutions:
- The APITestRegister's URL must be informed in the APITestGateway's appsettings.json:
- APITestGateway's swagger:
- APITestRegister's swagger:
- An authorization token must be created in the APITestGateway's method "/api/Gateway/Token".
- The parameter "route" informed in the APITestGateway's method "/api/Gateway/{route}" must have the pattern "Controller_Method". For example: the route "user_login" will allow the APITestGateway to access the APITestRegister's method "/api/User/Login".
- The parameters sent in the request must be the same as the ones the APITestRegister's methods expect to receive.