Skip to content

Latest commit

 

History

History
70 lines (52 loc) · 2.39 KB

File metadata and controls

70 lines (52 loc) · 2.39 KB

AuthEndpoints

nuget issues downloads workflow CodeFactor license

A simple auth library for aspnetcore. AuthEndpoints library provides a set of minimal api endpoints to handle basic & authentication actions such as registration, email verification, reset password, login, logout, etc.

swagger_authendpoints

Endpoints

  • Identity api:
    • sign-up
    • email verification
    • account info
    • reset password
    • forgot password
    • enable 2fa
    • login
    • logout
    • confirm identity
  • Simple JWT:
    • Create (login)
    • Refresh
    • Verify

Installing via NuGet

The easiest way to install AuthEndpoints is via NuGet

Install the library using the following dotnet cli command:

dotnet add package AuthEndpoints --version 3.0.0-alpha.1

or in Visual Studio's Package Manager Console, enter the following command:

Install-Package AuthEndpoints

Quick start

// Program.cs

builder.Services
    .AddIdentityApiEndpoints<AppUser>() // <--
    .AddRoles<AppRole>()
    .AddEntityFrameworkStores<AppDbContext>()
    .AddDefaultTokenProviders();

var app = builder.Build();

...

app.UseAuthentication(); // <--
app.UseAuthorization(); // <--

...

app.MapAuthEndpointsIdentityApi(); // <--

app.Run();

Documentations

Documentation is available at https://madeyoga.github.io/AuthEndpoints/ and in docs directory.