Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/franzasilva/minimalendpoints

Minimal API with JWT Auth, Swagger, Api Versioning and HealthChecks
https://github.com/franzasilva/minimalendpoints

api-versioning authentication authorization dotnet-core dotnet8 dotnetcore healthcheck jwt minimal-api swagger

Last synced: about 1 month ago
JSON representation

Minimal API with JWT Auth, Swagger, Api Versioning and HealthChecks

Awesome Lists containing this project

README

        

# Minimal API with JWT Auth, Swagger, Api Versioning and HealthChecks.
**For testing purposes only, pre-created Roles Admin and User and user admin with password 123**
- [.NET 8](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8/overview);
- [JWT](https://jwt.io/)



Swagger and Api Versioning with JWT Auth






Using Swagger and JWT Auth

When trying to use an api that requires auth without a token, you receive the 401 Unauthorized error


User admin and password 123 to get a token


Use token to authorize


Now... 200 OK


Use the user API to create new users and update then with a role.

We can only use DummyEndpoint with Admin or User roles, while in UserEndpoint we only need a valid token





Healthcheck with some details

https://localhost:7101/healthcheck