Skip to content

A simple demo with JWT Auth APIs and Basic Auth APIs, with Swagger support. Swagger Security; Swagger Auth

License

Notifications You must be signed in to change notification settings

jhonsonk/ApiAuthDemo

 
 

Repository files navigation

JWT auth and Basic auth, Swagger UI Security Configuration

ko-fi

This repository demos a Web API project, ApiAuthDemo, which is configured to use JWT authentication globally, and some action methods can be configured to use Basic Auth using an attribute. The demo website root is its Swagger user interface.

There is another Console app BasicAuthApiConsumer, which is a demo to consume a Basic Authentication API endpoint. The Console app needs to run after you start the ApiAuthDemo website, and you can adjust the URL in the Console program accordingly.

Medium Articles

How to add Basic Authentication to an ASP.NET Core 3 Web API project.

How to configure security schemes for our API documentation in Swagger.

Screen recordings

Screen recording for an API with Basic Authentication

Screen recording for an API with Basic Authentication

Screen recording for API authentication in Swagger UI

Screen recording for API authentication in Swagger UI

License

Feel free to use the code in this repository as it is under MIT license.

ko-fi

About

A simple demo with JWT Auth APIs and Basic Auth APIs, with Swagger support. Swagger Security; Swagger Auth

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%