JwtAuthProvider is a .NET 8 Web API project that provides robust JWT (JSON Web Token) authentication services. It is designed to help secure your applications by issuing and validating JWT tokens, simplifying the implementation of authentication and authorization in your .NET solutions.
This token is used by https://github.com/VentixeEventManagement/ApiGateway to authroize access, (The other microservices are in a isolated enviroment)
- β Built with .NET 8
- π JWT token generation and validation
- π‘ RESTful API endpoints for authentication
- π Integrated with Swashbuckle (Swagger) for API documentation
- π§ͺ Unit and integration tests using xUnit and Moq
git clone https://github.com/your-username/JwtAuthProvider.git
cd JwtAuthProvider
2. Restore Dependencies
bash
dotnet restore
3. Configure Settings
Update the appsettings.json file with your JWT configuration and other necessary settings.
4. Run the Application
bash
dotnet run
Or open the project in Visual Studio 2022 and start debugging.
5. Access API Documentation
Once running, navigate to:
https://localhost:{port}/swagger
Explore and test the API endpoints using Swagger UI.
π Project Structure
Code
JwtAuthProvider/
βββ Controllers/ # API endpoints for authentication and token management
βββ Infrastructure/
β βββ Authentication/ # Core JWT logic and interfaces
βββ Properties/ # Launch settings for development
βββ appsettings.json # Application configuration
βββ JwtAuthProvider.Tests/ # Unit and integration tests
π§ͺ Testing
This project uses xUnit and Moq for unit and integration testing.
To run the tests:
bash
cd JwtAuthProvider.Tests
dotnet test
π¦ Dependencies
Microsoft.NET.Test.Sdk
Moq
Swashbuckle.AspNetCore
System.IdentityModel.Tokens.Jwt
xunit
xunit.runner.visualstudio