ApiAuthorization.Plugin 5.7.0

dotnet add package ApiAuthorization.Plugin --version 5.7.0                
NuGet\Install-Package ApiAuthorization.Plugin -Version 5.7.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.7.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ApiAuthorization.Plugin --version 5.7.0                
#r "nuget: ApiAuthorization.Plugin, 5.7.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.
// Install ApiAuthorization.Plugin as a Cake Addin
#addin nuget:?package=ApiAuthorization.Plugin&version=5.7.0

// Install ApiAuthorization.Plugin as a Cake Tool
#tool nuget:?package=ApiAuthorization.Plugin&version=5.7.0                

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. 
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.7.0 102 12/20/2024
5.6.1 122 6/12/2024
5.6.0 559 12/1/2023
5.5.2 137 11/25/2023
5.5.1 282 10/12/2023
5.5.0 155 10/9/2023
5.4.0 391 9/2/2023
5.3.0 166 7/30/2023
5.2.0 181 7/30/2023
5.1.0 167 6/11/2023
5.0.3 324 11/24/2022
5.0.0 338 11/13/2022
4.4.0 396 4/22/2022

Supports net 6.0, net8.0 and net9.0