Acontplus.Services
1.2.0
See the version list below for details.
dotnet add package Acontplus.Services --version 1.2.0
NuGet\Install-Package Acontplus.Services -Version 1.2.0
<PackageReference Include="Acontplus.Services" Version="1.2.0" />
<PackageVersion Include="Acontplus.Services" Version="1.2.0" />
<PackageReference Include="Acontplus.Services" />
paket add Acontplus.Services --version 1.2.0
#r "nuget: Acontplus.Services, 1.2.0"
#:package Acontplus.Services@1.2.0
#addin nuget:?package=Acontplus.Services&version=1.2.0
#tool nuget:?package=Acontplus.Services&version=1.2.0
Acontplus.Services
A modern .NET 9+ library for API services, authentication, claims, middleware, and configuration. Includes JWT, user context, and exception handling for robust enterprise APIs.
🚀 Features
- Platform-aware Configuration Loading - Dynamic app and shared config loading
- Claims-based User Context Extensions - Easy access to user info and claims
- Identity & JWT Authentication - Flexible and strict JWT setup
- User Context Service - Abstracted access to user claims
- Global Exception Handling Middleware - Robust error logging and API error responses
- Mobile Request Detection Middleware - Detects mobile clients via headers
📦 Installation
NuGet Package Manager
Install-Package Acontplus.Services
.NET CLI
dotnet add package Acontplus.Services
PackageReference
<ItemGroup>
<PackageReference Include="Acontplus.Services" Version="1.0.12" />
</ItemGroup>
🎯 Quick Start
1. Add JWT Authentication
using Microsoft.Extensions.DependencyInjection;
using Acontplus.Services.Extensions;
public void ConfigureServices(IServiceCollection services)
{
services.AddIdentityService(Configuration); // or AddIdentityServiceStrict
}
public void Configure(IApplicationBuilder app)
{
app.UseAuthentication();
app.UseAuthorization();
}
2. Use ClaimsPrincipal Extensions
using System.Security.Claims;
using Acontplus.Services.Extensions;
var username = user.GetUsername();
var email = user.GetEmail();
var userId = user.GetUserId();
3. Global Exception Middleware
app.UseMiddleware<ApiExceptionMiddleware>();
🔧 Advanced Usage
AppConfiguration
using Acontplus.Services.Configuration;
var config = AppConfiguration.Load();
User Context Service
using Acontplus.Services.Extensions;
services.AddHttpContextAccessor();
services.AddScoped<IUserContext, UserContext>();
JsonConfigurationService
Centralizes and standardizes System.Text.Json options for your application.
using Acontplus.Services.Configuration;
// Get default options for serialization
var options = JsonConfigurationService.GetDefaultOptions();
// For pretty-printing (development)
var prettyOptions = JsonConfigurationService.GetPrettyOptions();
// For strict API validation
var strictOptions = JsonConfigurationService.GetStrictOptions();
Integrate with ASP.NET Core
// In Program.cs or Startup.cs
using Acontplus.Services.Configuration;
var builder = WebApplication.CreateBuilder(args);
// Use default or strict options for all controllers and minimal APIs
JsonConfigurationService.ConfigureAspNetCore(builder.Services, useStrictMode: false);
// Or, environment-aware:
JsonConfigurationService.ConfigureAspNetCore(builder.Services, builder.Environment.IsDevelopment());
Dependency Injection
// Register as singleton for DI
JsonConfigurationService.RegisterJsonConfiguration(services);
// Then inject IJsonConfigurationProvider wherever needed
public class MyService
{
public MyService(IJsonConfigurationProvider jsonConfig) { ... }
}
📚 API Documentation
AppConfiguration- Platform/environment config loaderClaimsPrincipalExtensions- User/claim helpersApiExceptionMiddleware- Centralized error handlingUserContext- User info abstractionRequestContextOptions- Request context config
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
git clone https://github.com/Acontplus-S-A-S/acontplus-dotnet-libs.git
cd acontplus-dotnet-libs
dotnet restore
dotnet build
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
- 📧 Email: proyectos@acontplus.com
- 🐛 Issues: GitHub Issues
- 📖 Documentation: Wiki
👨💻 Author
Ivan Paz - @iferpaz7
🏢 Company
Acontplus S.A.S. - Enterprise software solutions
Built with ❤️ for the .NET community
| 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
- Acontplus.Core (>= 1.3.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 9.0.7)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.7)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.7)
- Microsoft.IdentityModel.Tokens (>= 8.12.1)
- System.IdentityModel.Tokens.Jwt (>= 8.12.1)
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 |
|---|---|---|
| 2.1.8 | 98 | 1/16/2026 |
| 2.1.7 | 97 | 1/11/2026 |
| 2.1.6 | 190 | 12/25/2025 |
| 2.1.5 | 183 | 12/23/2025 |
| 2.1.4 | 217 | 12/11/2025 |
| 2.1.3 | 305 | 12/7/2025 |
| 2.1.2 | 170 | 12/5/2025 |
| 2.1.1 | 206 | 12/4/2025 |
| 2.1.0 | 209 | 12/3/2025 |
| 2.0.2 | 193 | 11/26/2025 |
| 2.0.1 | 187 | 11/26/2025 |
| 2.0.0 | 198 | 11/23/2025 |
| 1.6.3 | 399 | 11/17/2025 |
| 1.6.2 | 405 | 11/17/2025 |
| 1.6.1 | 346 | 11/17/2025 |
| 1.6.0 | 277 | 11/10/2025 |
| 1.5.19 | 197 | 11/5/2025 |
| 1.5.18 | 208 | 11/5/2025 |
| 1.5.17 | 183 | 10/23/2025 |
| 1.5.16 | 197 | 9/26/2025 |
| 1.5.15 | 198 | 9/25/2025 |
| 1.5.14 | 217 | 9/25/2025 |
| 1.5.13 | 192 | 9/24/2025 |
| 1.5.12 | 240 | 9/14/2025 |
| 1.5.11 | 241 | 9/14/2025 |
| 1.5.10 | 242 | 9/14/2025 |
| 1.5.9 | 195 | 9/10/2025 |
| 1.5.8 | 200 | 9/9/2025 |
| 1.5.7 | 204 | 9/4/2025 |
| 1.5.6 | 224 | 8/24/2025 |
| 1.5.5 | 182 | 8/21/2025 |
| 1.5.4 | 183 | 8/19/2025 |
| 1.5.3 | 204 | 8/13/2025 |
| 1.5.2 | 197 | 8/13/2025 |
| 1.5.1 | 190 | 8/11/2025 |
| 1.5.0 | 188 | 8/11/2025 |
| 1.4.4 | 189 | 8/8/2025 |
| 1.4.3 | 185 | 8/8/2025 |
| 1.4.2 | 264 | 8/7/2025 |
| 1.4.1 | 271 | 8/7/2025 |
| 1.4.0 | 265 | 8/7/2025 |
| 1.3.2 | 270 | 8/5/2025 |
| 1.3.1 | 603 | 7/23/2025 |
| 1.3.0 | 142 | 7/18/2025 |
| 1.2.0 | 188 | 7/14/2025 |
| 1.1.4 | 191 | 7/14/2025 |
| 1.1.3 | 141 | 7/11/2025 |
| 1.1.2 | 143 | 7/11/2025 |
| 1.1.1 | 189 | 7/10/2025 |
| 1.1.0 | 204 | 7/10/2025 |
| 1.0.12 | 182 | 7/10/2025 |
| 1.0.11 | 190 | 7/9/2025 |
| 1.0.10 | 194 | 7/9/2025 |
| 1.0.9 | 193 | 7/6/2025 |
| 1.0.8 | 194 | 7/6/2025 |
| 1.0.7 | 189 | 7/6/2025 |
| 1.0.6 | 142 | 7/4/2025 |
| 1.0.5 | 194 | 7/2/2025 |
| 1.0.4 | 198 | 7/2/2025 |
| 1.0.3 | 204 | 7/2/2025 |
| 1.0.2 | 199 | 7/1/2025 |
Updated for .NET 9+ with modern C# features, improved middleware, and enhanced documentation.