Skip to content

Use Minimal API to perform a minimal Authentication mode

License

Notifications You must be signed in to change notification settings

charset/Minimal.Auth

Repository files navigation

Minimal.Auth

Minimal.Auth demonstrated to use Minimal API in .NET 6 and Authentication with simple minimal requirement code. The project contains two parts of cause: Minimal API and Minimal Authentication.

I have an article written in Chinese to show minimal authentication logic. The code uses Controller as Authentication Web API.

Blazor 极简登录模型

When .NET 6 launched up, I am eager to migrate controller web APIs to Minimal API which brings easy-to-use to us. One can write an extension class to wrap all details and throws controllers away.

Minimal API

3 APIs are required. All path strings can be customized.

/Auth/Login

/Auth/Logout

/Auth/CurrentUser

Authentication

Authentication logic does not change because we just implement AuthenticationStateProvider.

WARNING Most of the code is only for demo and not for product use.

About

Use Minimal API to perform a minimal Authentication mode

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published