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
                    
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="Doxo.Auth.PostgreSQL" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Doxo.Auth.PostgreSQL" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Doxo.Auth.PostgreSQL" />
                    
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 Doxo.Auth.PostgreSQL --version 1.0.1
                    
#r "nuget: Doxo.Auth.PostgreSQL, 1.0.1"
                    
#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 Doxo.Auth.PostgreSQL@1.0.1
                    
#: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=Doxo.Auth.PostgreSQL&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Doxo.Auth.PostgreSQL&version=1.0.1
                    
Install as a Cake Tool

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

  1. Set your PostgreSQL connection string in appsettings.json:
"ConnectionStrings": {
  "AuthDb": "Host=localhost;Database=authdb;Username=user;Password=password"
}
  1. 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 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. 
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
1.0.1 199 11/26/2025