AuthEndpoints 1.4.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package AuthEndpoints --version 1.4.9                
NuGet\Install-Package AuthEndpoints -Version 1.4.9                
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" Version="1.4.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AuthEndpoints --version 1.4.9                
#r "nuget: AuthEndpoints, 1.4.9"                
#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 as a Cake Addin
#addin nuget:?package=AuthEndpoints&version=1.4.9

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

AuthEndpoints

nuget issues downloads workflow CodeFactor 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, create jwt, etc. It works with custom identity user model. AuthEndpoints is built with the aim of increasing developer productivity.

Features

  • Supported endpoints:
    • sign-up
    • sign-in (create jwt)
    • email verification
    • refresh jwt
    • verify jwt
    • user profile (retrieving)
    • reset password
    • change password
    • enable 2fa & login 2fa (via email)
  • JWT support
  • Works with a symmetric key (shared secret) or asymmetric keys (the private key of a private–public pair).
  • Works with custom identity user

Current limitations

  • Only works with IdentityUser or custom identity user
  • No session based auth support
  • 2fa via email

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.MinimalApi

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

Install-Package AuthEndpoints.MinimalApi

Quick start

Add the required identity services:

builder.Services
  .AddIdentityCore<MyCustomIdentityUser>() // <-- or `AddIdentity<,>`
  .AddEntityFrameworkStores<MyDbContext>() // <--
  .AddDefaultTokenProviders();             // <--

Next, let's add auth endpoints services and jwt bearer authentication scheme:

builder.Services
  // When no options provided, 
  // AuthEndpoints will automatically create a secret key and use single security key
  // for each access jwt and refresh jwt (symmetric encryption).
  // Secrets will be created under `keys/` directory.
  .AddAuthEndpoints<string, MyCustomIdentityUser>() // <TUserKey, TUser>
  .AddAllEndpointDefinitions() // Add endpoint definitions
  .AddJwtBearerAuthScheme();

then finally, call app.MapAuthEndpoints() before app.Run():


var app = builder.Build();

...

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

...

app.MapAuthEndpoints(); // <--

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.2.0 1,101 9/24/2022
2.1.1 983 9/9/2022
2.1.0 1,014 9/9/2022 2.1.0 is deprecated because it has critical bugs.
2.0.2 1,022 9/3/2022
2.0.1 948 8/31/2022
2.0.0 1,009 8/22/2022 2.0.0 is deprecated because it has critical bugs.
1.7.0 1,020 8/10/2022 1.7.0 is deprecated because it is no longer maintained.
1.6.0 1,006 8/8/2022 1.6.0 is deprecated because it is no longer maintained.
1.5.0 956 8/2/2022 1.5.0 is deprecated because it is no longer maintained.
1.4.9 1,027 7/30/2022 1.4.9 is deprecated because it is no longer maintained.
1.4.8 999 7/27/2022 1.4.8 is deprecated because it is no longer maintained.
1.4.7 1,108 7/17/2022 1.4.7 is deprecated because it is no longer maintained.
1.4.6 991 6/25/2022 1.4.6 is deprecated because it is no longer maintained.
1.4.5 999 6/20/2022 1.4.5 is deprecated because it is no longer maintained.
1.4.4 1,011 6/18/2022 1.4.4 is deprecated because it is no longer maintained.
1.4.3 974 6/16/2022 1.4.3 is deprecated because it is no longer maintained.
1.4.2 1,061 6/14/2022 1.4.2 is deprecated because it is no longer maintained.
1.4.1 1,026 6/11/2022 1.4.1 is deprecated because it is no longer maintained.
1.4.0 1,073 6/6/2022 1.4.0 is deprecated because it is no longer maintained.
1.3.0 1,001 6/2/2022 1.3.0 is deprecated because it is no longer maintained.
1.2.0 1,000 5/30/2022 1.2.0 is deprecated because it is no longer maintained.
1.1.0 1,008 5/26/2022 1.1.0 is deprecated because it is no longer maintained.
1.0.1 979 5/25/2022 1.0.1 is deprecated because it is no longer maintained.
1.0.0 1,011 5/24/2022 1.0.0 is deprecated because it is no longer maintained.

Update core & Minimal Api 1.4.5