JonPSmith / AuthPermissions.AspNetCore

This library provides extra authorization and multi-tenant features to an ASP.NET Core application.
https://www.thereformedprogrammer.net/finally-a-library-that-improves-role-authorization-in-asp-net-core/
MIT License
798 stars 160 forks source link
asp-net-core aspnetcore authorization jwt-token multi-tenant saas

AuthPermissions.AspNetCore

The AuthPermissions.AspNetCore library (shortened to AuthP) provides extra authorization features to a ASP.NET Core application. Here are AuthP's three main features:

The AuthP is an open-source library under the MIT licence (and remain as a open-source library for ever) and the NuGet package can be found here. The documentation can be found in the GitHub wiki and the AuthP roadmap defines the different versions of this library.

List of versions and which .NET framework they support

If you have already built your application using an older version, then you need to look at the following "how up update" documents

The AuthP library also:

How to create an AuthPermissions.AspNetCore NuGet package

The AuthPermissions.AspNetCore library contains more than one project. For this reason you can't (currently) create a NuGet package using NuGet values in a .csproj file. For this reason I created a JonPSmith.MultiProjPack dotnet tool to create the NuGet package using the following command in a command line on the AuthPermissions.AspNetCore directory.

See JonPSmith.MultiProjPack GitHub for why I created the JonPSmith.MultiProjPack and more about its features.

1. Install the MultiProjPack dotnet tool

On your computer you need to install the global tool using the command below (see this documentation to learn about global tools).

dotnet tool install JonPSmith.MultiProjPack --global

NOTE: To update the MultiProjPack .NET tool you need to run the command dotnet tool update JonPSmith.MultiProjPack --global. Or to uninstall this tool you should use dotnet tool uninstall JonPSmith.MultiProjPack --global command.

2. Compile the AuthPermissions.AspNetCore in release Mode

You must select "Release" compile mode and then use the "Build > Rebuild Solution" to ensure a new release version of the AuthPermissions.AspNetCore is available.

3. Run the MultiProjPack tool to create the

You run the MultiProjPack tool from a command line in the AuthPermissions.AspNetCore directory. I use Visual Studio's "Open in Terminal" using the command below ("R" is short for "Release")

MultiProjPack R

NOTE: If you want to create a new version of the NuGet package you must update the NuGet version and most likely the releaseNotes in the MultiProjPack.xml before you call the MultiProjPack tool.

The created .nupkg file will be found in the AuthPermissions.AspNetCore.nupkg directory AND in the user's {USERPROFILE}\LocalNuGet directory.