DotNetBrightener.Infrastructure.Security
2025.0.10
See the version list below for details.
dotnet add package DotNetBrightener.Infrastructure.Security --version 2025.0.10
NuGet\Install-Package DotNetBrightener.Infrastructure.Security -Version 2025.0.10
<PackageReference Include="DotNetBrightener.Infrastructure.Security" Version="2025.0.10" />
<PackageVersion Include="DotNetBrightener.Infrastructure.Security" Version="2025.0.10" />
<PackageReference Include="DotNetBrightener.Infrastructure.Security" />
paket add DotNetBrightener.Infrastructure.Security --version 2025.0.10
#r "nuget: DotNetBrightener.Infrastructure.Security, 2025.0.10"
#:package DotNetBrightener.Infrastructure.Security@2025.0.10
#addin nuget:?package=DotNetBrightener.Infrastructure.Security&version=2025.0.10
#tool nuget:?package=DotNetBrightener.Infrastructure.Security&version=2025.0.10
Security Infratructure Library
© DotNet Brightener
Installation
Run this in command line:
dotnet add package DotNetBrightener.Infrastructure.Security
Or add the following to .csproj file
<PackageReference Include="DotNetBrightener.Infrastructure.Security" Version="2022.10.0" />
You should check the latest version from Nuget Site
Adding Permission System
- Register the Permission System to
IServiceCollection
serviceCollection.AddPermissionAuthorization();
- Calling the following before application starts.
var app = builder.Build();
// call this before app.Run()
app.LoadAndValidatePermissions();
app.Run();
If you use legacy Startup.cs file then the app.LoadAndValidatePermissions() should be called in Configure() method
Authorization Extensions
- Authorize with
IAuthorizationService
var authorizationResult = await IAuthorizationService.AuthorizePermissionAsync(user, permissionKey);
- Authorize with
[PermissionAuthorize]attribute
public class SomeController: Controller
{
[PermissionAuthorize("<your_permission_key>")]
public async Task<IActionResult> SomeAction()
{
// your action implementation
}
}
Automatically Register Permissions
Given the following class for defining permissions
public class SomePermissionsList: AutomaticPermissionProvider
{
/// <summary>
/// Description for Permission 1
/// </summary>
public const string Permission1 = "ThisIsKey.OfThePermission";
/// <summary>
/// Description for Permission 2
/// </summary>
public const string Permission2 = "Permission.Permission2";
}
You can register the permissions defined in this class into service collection by doing the following:
// with SomePermissionsList is the type of permission provider
serviceCollection.RegisterPermissionProvider<SomePermissionsList>();
The app.LoadAndValidatePermissions() call above should automatically register the permissions you defined in the class provided
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net9.0
- DotNetBrightener.CryptoEngine (>= 2025.0.10)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on DotNetBrightener.Infrastructure.Security:
| Package | Downloads |
|---|---|
|
DotNetBrightener.Infrastructure.JwtAuthentication
Package Description |
|
|
DotNetBrightener.Infrastructure.ApiKeyAuthentication
Package Description |
|
|
DotNetBrightener.WebApp.CommonShared
Package Description |
|
|
DotNetBrightener.MultiTenancy
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.0.1-preview-733 | 126 | 2/6/2026 |
| 2026.0.1-preview-731 | 145 | 2/3/2026 |
| 2026.0.1-preview-728 | 147 | 1/20/2026 |
| 2026.0.1-preview-723 | 129 | 1/15/2026 |
| 2026.0.1-preview-721 | 133 | 1/15/2026 |
| 2026.0.1-preview-717 | 153 | 1/5/2026 |
| 2026.0.1-preview-713 | 517 | 12/10/2025 |
| 2026.0.1-preview-700 | 275 | 12/7/2025 |
| 2026.0.1-preview-689 | 160 | 12/6/2025 |
| 2026.0.1-preview-676 | 732 | 12/2/2025 |
| 2026.0.1-preview-671 | 169 | 11/29/2025 |
| 2026.0.1-preview-670 | 173 | 11/29/2025 |
| 2026.0.1-preview-669 | 160 | 11/29/2025 |
| 2026.0.1-preview-667 | 233 | 11/27/2025 |
| 2026.0.1-preview-665 | 215 | 11/27/2025 |
| 2026.0.1-preview-664 | 232 | 11/27/2025 |
| 2025.0.10 | 269 | 11/25/2025 |
Basic infrastructure provided for authorizing User with given permission