AuthEndpoints.MinimalApi 1.4.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package AuthEndpoints.MinimalApi --version 1.4.1                
NuGet\Install-Package AuthEndpoints.MinimalApi -Version 1.4.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AuthEndpoints.MinimalApi" Version="1.4.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AuthEndpoints.MinimalApi --version 1.4.1                
#r "nuget: AuthEndpoints.MinimalApi, 1.4.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AuthEndpoints.MinimalApi as a Cake Addin
#addin nuget:?package=AuthEndpoints.MinimalApi&version=1.4.1

// Install AuthEndpoints.MinimalApi as a Cake Tool
#tool nuget:?package=AuthEndpoints.MinimalApi&version=1.4.1                

AuthEndpoints

nuget issues downloads workflow license

A simple jwt authentication library for ASP.Net 6. AuthEndpoints library provides a set of Web API controllers and minimal api endpoints to handle basic web & JWT authentication actions such as registration, email verification, reset password, etc. It works with custom identity user model. AuthEndpoints is built with the aim of increasing developer productivity.

Installing via NuGet

The easiest way to install AuthEndpoints is via NuGet

Install the library using the following .net cli command:

dotnet add package AuthEndpoints

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

Install-Package AuthEndpoints

Quick start

Edit Program.cs, then add the required identity services:

builder.Services.AddIdentity<MyCustomIdentityUser>()
  .AddEntityFrameworkStores<MyDbContext>()
  .AddDefaultTokenProviders();

then add auth endpoints services and enable jwt bearer authentication

builder.Services
  .AddAuthEndpoints<string, MyCustomIdentityUser>() // Use the default and minimum config
  .AddJwtBearerAuthScheme();

Map endpoints using the controller

public class MyBaseAuthController : BasicAuthenticationController<string, MyCustomIdentityUser>
{}

public class MyJwtController : JwtController<string, MyCustomIdentityUser>
{}

public class MyTwoFactorController : TwoStepVerificationController<string, MyCustomIdentityUser>
{}

or

Map endpoints using the minimal api

Install AuthEndpoints.MinimalApi package, then edit Program.cs:

builder.Services
  .AddAuthEndpoints<string, MyCustomIdentityUser>()
  .AddAllEndpointDefinitions() // add basic auth, jwt, 2fa endpoints
  .AddJwtBearerAuthScheme();

var app = builder.Build();

...

app.UseAuthentication();
app.UseAuthorization();

...

app.MapAuthEndpoints(); // Map minimal api endpoints

app.Run();

Checkout docs for more info.

Documentations

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

Contributing

Your contributions are always welcome! simply send a pull request! The up-for-grabs label is a great place to start. If you find a flaw, please open an issue or a PR and let's sort things out.

The documentation is far from perfect so every bit of help is more than welcome.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AuthEndpoints.MinimalApi:

Package Downloads
AuthEndpoints

A simple jwt auth library for Asp.Net 6 that provides a set of web api controllers and minimal api endpoints to handle authentication actions

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.2.0 980 9/24/2022
2.1.0 1,107 9/9/2022
2.0.0 1,429 8/22/2022
1.7.0 818 8/10/2022
1.6.0 801 8/8/2022
1.5.0 790 8/2/2022
1.4.5 810 7/30/2022
1.4.4 827 7/22/2022
1.4.3 507 7/17/2022
1.4.2 444 6/25/2022
1.4.1 447 6/19/2022
1.4.0 470 6/18/2022

Minimal api