ApiAuthorization.Plugin 5.9.0

dotnet add package ApiAuthorization.Plugin --version 5.9.0
                    
NuGet\Install-Package ApiAuthorization.Plugin -Version 5.9.0
                    
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="ApiAuthorization.Plugin" Version="5.9.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ApiAuthorization.Plugin" Version="5.9.0" />
                    
Directory.Packages.props
<PackageReference Include="ApiAuthorization.Plugin" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ApiAuthorization.Plugin --version 5.9.0
                    
#r "nuget: ApiAuthorization.Plugin, 5.9.0"
                    
#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.
#:package ApiAuthorization.Plugin@5.9.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ApiAuthorization.Plugin&version=5.9.0
                    
Install as a Cake Addin
#tool nuget:?package=ApiAuthorization.Plugin&version=5.9.0
                    
Install as a Cake Tool

This package is one of many packages that can be used with Plugin Manager which can be used to extend any c#/.net based application (MVC, Winform, WPF, MAUI etc) by using a Modular Approach.

API Authorization Plugin

There are many different ways in which you can secure an Api endpoint so that the resources are only used by those authorised to use them.

When writing open and accesible Api's that can be used across a public domain it is important to follow some basic principles, these being:

  • Prioritize Security. Think about the type of security that you want to employ for endpoints at the start of a project, do not leave it as an afterthought, or believe that it's somebody elses issue.
  • Use a strong authentication solution. Authenticating a user, using industry standard techniques can help protect data and ensure that only those requiring access to data are able to get access.
  • Use authorization. Just because a user can authenticate, it does not mean the should have carte blanche once authentication is successfull. Using a principal of least privilege can help ensure that a user is not authorized to perform any action unless that action has been specifically granted.

Implementing Api Authorization

Api authorization is accomplished by applying an attribute to the endpoint or controller for all endpoints and implementing two interfaces

ApiAuthorizationAttribute. An attribute that is put on each controller or individual action endpoint. IApiAuthorizationService. The application must register an instance of IApiAuthorizationService within the service container. This interface contains one method and is used by the attribute to validate the request. IUserApiQueryProvider. The application must register an instance of IUserApiQueryProvider within the service container.

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 is compatible.  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.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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
5.9.0 111 8/10/2025
5.8.0 131 7/29/2025
5.7.0 165 12/20/2024
5.6.1 173 6/12/2024
5.6.0 586 12/1/2023
5.5.2 177 11/25/2023
5.5.1 313 10/12/2023
5.5.0 200 10/9/2023
5.4.0 442 9/2/2023
5.3.0 216 7/30/2023
5.2.0 233 7/30/2023
5.1.0 229 6/11/2023
5.0.3 401 11/24/2022
5.0.0 411 11/13/2022
4.4.0 487 4/22/2022

Supports net 6.0, net8.0 and net9.0