Doxo.Auth.PostgreSQL
1.0.1
dotnet add package Doxo.Auth.PostgreSQL --version 1.0.1
NuGet\Install-Package Doxo.Auth.PostgreSQL -Version 1.0.1
<PackageReference Include="Doxo.Auth.PostgreSQL" Version="1.0.1" />
<PackageVersion Include="Doxo.Auth.PostgreSQL" Version="1.0.1" />
<PackageReference Include="Doxo.Auth.PostgreSQL" />
paket add Doxo.Auth.PostgreSQL --version 1.0.1
#r "nuget: Doxo.Auth.PostgreSQL, 1.0.1"
#:package Doxo.Auth.PostgreSQL@1.0.1
#addin nuget:?package=Doxo.Auth.PostgreSQL&version=1.0.1
#tool nuget:?package=Doxo.Auth.PostgreSQL&version=1.0.1
Auth.PostgreSQL
Auth.PostgreSQL is a C# library for authentication and authorization based on JWT tokens, generated from user credentials (username, password) and permission groups stored in PostgreSQL. It provides secure identity validation and role-based access control for modern applications.
Features
- Authentication using username and password
- JWT token generation and validation
- Role and permission management via PostgreSQL groups
- Middleware for ASP.NET Core
- Compatible with .NET 8
Installation
Add the library to your project via NuGet:
dotnet add package Doxo.Auth.PostgreSQL
Configuration
- Set your PostgreSQL connection string in
appsettings.json:
"ConnectionStrings": {
"AuthDb": "Host=localhost;Database=authdb;Username=user;Password=password"
}
- Register the services in your
Program.cs:
builder.Services.AddAuthenticationApiPostgreSQL(builder.Configuration.GetConnectionString("AuthDb"));
Usage
Authentication
var token = await authService.AuthenticateAsync(username, password);
Authorization
Protect controllers or actions with attributes:
[Authorize(Roles = "Admin")]
public IActionResult GetSecretData() { ... }
Database Structure
The library expects tables for users, roles, and permissions. See the documentation for the detailed schema.
Example
See the examples/ folder for an integration example with ASP.NET Core.
Contributing
Pull requests are welcome! Open an issue for suggestions or bugs.
License
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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. |
-
net8.0
- Doxo.Mediator (>= 1.0.2)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.21)
- Microsoft.AspNetCore.Mvc.Abstractions (>= 2.3.0)
- Microsoft.AspNetCore.Mvc.Core (>= 2.3.0)
- Microsoft.EntityFrameworkCore (>= 8.0.22)
- Microsoft.Extensions.Caching.Memory (>= 9.0.10)
- Microsoft.Extensions.Identity.Core (>= 9.0.10)
- Microsoft.IdentityModel.Tokens (>= 8.15.0)
- Microsoft.OpenApi (>= 1.6.25)
- Npgsql (>= 8.0.8)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 8.0.11)
- Swashbuckle.AspNetCore (>= 9.0.6)
- System.IdentityModel.Tokens.Jwt (>= 8.15.0)
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 |
|---|---|---|
| 1.0.1 | 199 | 11/26/2025 |