LoRemmit.Shared.Library
1.2.95
dotnet add package LoRemmit.Shared.Library --version 1.2.95
NuGet\Install-Package LoRemmit.Shared.Library -Version 1.2.95
<PackageReference Include="LoRemmit.Shared.Library" Version="1.2.95" />
<PackageVersion Include="LoRemmit.Shared.Library" Version="1.2.95" />
<PackageReference Include="LoRemmit.Shared.Library" />
paket add LoRemmit.Shared.Library --version 1.2.95
#r "nuget: LoRemmit.Shared.Library, 1.2.95"
#:package LoRemmit.Shared.Library@1.2.95
#addin nuget:?package=LoRemmit.Shared.Library&version=1.2.95
#tool nuget:?package=LoRemmit.Shared.Library&version=1.2.95
Introduction
TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project.
Getting Started
TODO: Guide users through getting your code up and running on their own system. In this section you can talk about:
- Installation process
- Software dependencies
- Latest releases
- API references
Build and Test
TODO: Describe and show how to build your code and run the tests.
Contribute
TODO: Explain how other users and developers can contribute to make your code better If you want to learn more about creating good readme files then refer the following guidelines. You can also seek inspiration from the below readme files:
LoRemmit Shared Library
A comprehensive .NET 8 shared library providing authentication, JWT token blacklisting, Redis caching, HTTP client services, and common utilities for LoRemmit applications.
Features
- 🔐 JWT Authentication & Authorization - Complete JWT token validation with role and permission-based authorization
- 🚫 JWT Token Blacklisting - Environment-aware token revocation with Redis backend
- 🗄️ Redis Service - Environment-isolated caching with automatic key prefixing
- 🌐 HTTP Client Services - Polly-based resilient HTTP clients with retry policies
- 🔧 Common Utilities - Helpers for encryption, serialization, pagination, and more
- 📝 Rich ViewModels - Ready-to-use models for Dojah, Sumsub, and other integrations
Installation
From NuGetdotnet add package LoRemmit.Shared.Library
From Sourcegit clone https://github.com/your-repo/LoRemmit-Shared
cd LoRemmit-Shared/LoRemmit-Shared.Library dotnet build
Quick Start
1. Authentication Setup
// Program.cs using LoRemmit_Shared.Library.ServiceCollectionExtensions.AuthenticationExtension; using LoRemmit_Shared.Library.Validation.Authentication;
var builder = WebApplication.CreateBuilder(args);
// Register authentication services builder.Services.AddSharedAuthenticationServices(builder.Configuration);
var app = builder.Build();
// Configure middleware pipeline app.UseAuthentication(); app.UseTokenBlacklist(); // JWT blacklist middleware app.UseAuthorization();
app.MapControllers(); app.Run();
2. Configuration
{ "ConnectionStrings": { "Redis": "your-redis-connection-string" }, "Redis": { "ConnectionString": "your-redis-connection-string", "InstanceName": "URP-Central" }, "JwtSettings": { "Issuer": "your-issuer", "Audience": "your-audience", "SecretKey": "your-secret-key" } }
3. Controller Usage
[ApiController] [Route("api/[controller]")] public class TestController : ControllerBase { private readonly ICurrentUser _currentUser; private readonly ITokenBlacklistService _blacklistService; private readonly IRedisService _redisService;
public TestController(
ICurrentUser currentUser,
ITokenBlacklistService blacklistService,
IRedisService redisService)
{
_currentUser = currentUser;
_blacklistService = blacklistService;
_redisService = redisService;
}
[HttpGet("protected")]
[Authorize]
public IActionResult GetProtectedData()
{
var userId = _currentUser.GetUserId();
var email = _currentUser.GetEmail();
return Ok(new { UserId = userId, Email = email });
}
[HttpPost("logout")]
[Authorize]
public async Task<IActionResult> Logout()
{
var jti = _currentUser.GetJwtId();
var expClaim = _currentUser.GetClaimValue("exp");
var expiration = DateTimeOffset.UtcNow.AddDays(1);
if (!string.IsNullOrEmpty(expClaim) && long.TryParse(expClaim, out var exp))
{
expiration = DateTimeOffset.FromUnixTimeSeconds(exp);
}
await _blacklistService.BlacklistTokenAsync(jti, expiration);
return Ok(new { Message = "Logged out successfully" });
}
}
Core Services
Authentication Services
- ICurrentUser - Get current user claims and information
- ITokenBlacklistService - Manage JWT token blacklisting
- PermissionFilter - Role and permission-based authorization
Redis Service
- IRedisService - Environment-aware caching with automatic key prefixing
- Supports:
SetAsync,GetAsync,RemoveAsync,ExistsAsync
HTTP Client Service
- IHttpClientAppService - Resilient HTTP client with Polly retry policies
- Supports: JSON, form-encoded, and custom requests
Advanced Features
Role-Based Authorization[HttpGet("admin-only")]
[RequiresRole("Administrator")] public IActionResult AdminEndpoint() ⇒ Ok();
Permission-Based Authorization[HttpPost("create-user")]
[RequiresPermission("UserManagement", "Create")] public IActionResult CreateUser() ⇒ Ok();
Redis Caching// Set cache with expiration
await _redisService.SetAsync("user:123", userData, 3600); // 1 hour
// Get cached data var userData = await _redisService.GetAsync("user:123");
// Check existence var exists = await _redisService.ExistsAsync("user:123");
Environment Isolation
The Redis service automatically prefixes all keys with the current environment:
- Development:
Development_user:123 - Staging:
Staging_user:123 - Production:
Production_user:123
This ensures complete data isolation between environments.
Dependencies
- .NET 8.0
- Microsoft.AspNetCore.Authentication.JwtBearer
- StackExchange.Redis
- Microsoft.EntityFrameworkCore
- Polly (for HTTP resilience)
- System.IdentityModel.Tokens.Jwt
Build and Test
Build the library
dotnet build
Run tests (if available)
dotnet test
Create NuGet package
dotnet pack
Publishing to NuGet
Update version in .csproj first, then:
dotnet pack dotnet nuget push LoRemmit.Shared.Library.{version}.nupkg --api-key {your-api-key} --source https://api.nuget.org/v3/index.json
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For issues and questions, please create an issue in the repository or contact the development team.
Version: 1.2.89
Authors: EminenceTobi
Company: mcAdware Solutions
nuget oy2krnyyex3dmwvgvaoatzy6bultxjjutn62md5y7hcyii
dotnet nuget push LoRemmit.Shared.Library.1.2.95.nupkg --api-key oy2krnyyex3dmwvgvaoatzy6bultxjjutn62md5y7hcyii --source https://api.nuget.org/v3/index.json
| 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
- MediatR (>= 12.4.1)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.13)
- Microsoft.EntityFrameworkCore (>= 9.0.2)
- Microsoft.Extensions.Caching.StackExchangeRedis (>= 9.0.8)
- Microsoft.Extensions.Http (>= 9.0.1)
- Microsoft.Extensions.Http.Polly (>= 9.0.1)
- Newtonsoft.Json (>= 13.0.3)
- Polly (>= 8.5.2)
- Polly.Extensions.Http (>= 3.0.0)
- Portable.BouncyCastle (>= 1.9.0)
- StackExchange.Redis (>= 2.8.16)
- System.IdentityModel.Tokens.Jwt (>= 8.6.0)
- X.PagedList.Mvc.Core (>= 10.5.7)
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.2.95 | 112 | 10/21/2025 | |
| 1.2.94 | 168 | 9/30/2025 | |
| 1.2.93 | 172 | 9/13/2025 | |
| 1.2.92 | 136 | 9/13/2025 | |
| 1.2.91 | 84 | 9/12/2025 | |
| 1.2.90 | 233 | 8/31/2025 | |
| 1.2.89 | 164 | 8/31/2025 | |
| 1.2.88 | 173 | 8/31/2025 | |
| 1.2.87 | 179 | 8/31/2025 | |
| 1.2.86 | 384 | 8/5/2025 | |
| 1.2.85 | 330 | 8/5/2025 | |
| 1.2.84 | 178 | 8/4/2025 | |
| 1.2.83 | 158 | 7/29/2025 | |
| 1.2.82 | 220 | 6/24/2025 | |
| 1.2.81 | 355 | 6/10/2025 | |
| 1.2.80 | 204 | 6/2/2025 | |
| 1.2.79 | 213 | 5/28/2025 | |
| 1.2.78 | 198 | 5/25/2025 | |
| 1.2.77 | 180 | 5/25/2025 | |
| 1.2.76 | 175 | 5/25/2025 | |
| 1.2.75 | 149 | 5/24/2025 | |
| 1.2.74 | 174 | 5/18/2025 | |
| 1.2.73 | 192 | 5/11/2025 | |
| 1.2.72 | 190 | 5/11/2025 | |
| 1.2.71 | 181 | 5/11/2025 | |
| 1.2.70 | 222 | 5/11/2025 | |
| 1.2.69 | 214 | 5/7/2025 | |
| 1.2.68 | 190 | 5/6/2025 | |
| 1.2.67 | 172 | 5/2/2025 | |
| 1.2.66 | 214 | 4/29/2025 | |
| 1.2.65 | 210 | 4/27/2025 | |
| 1.2.64 | 251 | 4/23/2025 | |
| 1.2.63 | 266 | 4/23/2025 | |
| 1.2.62 | 260 | 4/21/2025 | |
| 1.2.61 | 209 | 4/20/2025 | |
| 1.2.60 | 320 | 4/20/2025 | |
| 1.2.59 | 213 | 4/20/2025 | |
| 1.2.58 | 166 | 4/19/2025 | |
| 1.2.57 | 191 | 4/18/2025 | |
| 1.2.56 | 256 | 4/16/2025 | |
| 1.2.55 | 233 | 4/16/2025 | |
| 1.2.54 | 253 | 4/14/2025 | |
| 1.2.53 | 287 | 4/14/2025 | |
| 1.2.52 | 235 | 4/14/2025 | |
| 1.2.51 | 230 | 4/13/2025 | |
| 1.2.50 | 243 | 4/13/2025 | |
| 1.2.49 | 225 | 4/13/2025 | |
| 1.2.48 | 157 | 4/12/2025 | |
| 1.2.47 | 190 | 4/12/2025 | |
| 1.2.46 | 192 | 4/11/2025 | |
| 1.2.45 | 191 | 4/10/2025 | |
| 1.2.44 | 216 | 4/9/2025 | |
| 1.2.43 | 215 | 4/9/2025 | |
| 1.2.42 | 201 | 4/9/2025 | |
| 1.2.41 | 201 | 4/9/2025 | |
| 1.2.40 | 214 | 4/8/2025 | |
| 1.2.39 | 205 | 4/8/2025 | |
| 1.2.38 | 212 | 4/8/2025 | |
| 1.2.37 | 217 | 4/8/2025 | |
| 1.2.36 | 201 | 4/7/2025 | |
| 1.2.35 | 221 | 4/7/2025 | |
| 1.2.34 | 187 | 4/6/2025 | |
| 1.2.33 | 246 | 3/31/2025 | |
| 1.2.32 | 202 | 3/31/2025 | |
| 1.2.31 | 206 | 3/31/2025 | |
| 1.2.30 | 160 | 3/29/2025 | |
| 1.2.29 | 182 | 3/29/2025 | |
| 1.2.28 | 172 | 3/28/2025 | |
| 1.2.27 | 164 | 3/28/2025 | |
| 1.2.26 | 182 | 3/28/2025 | |
| 1.2.25 | 167 | 3/28/2025 | |
| 1.2.24 | 172 | 3/28/2025 | |
| 1.2.23 | 177 | 3/28/2025 | |
| 1.2.22 | 182 | 3/27/2025 | |
| 1.2.21 | 151 | 3/27/2025 | |
| 1.2.19 | 188 | 3/27/2025 | |
| 1.2.18 | 170 | 3/27/2025 | |
| 1.2.17 | 199 | 3/27/2025 | |
| 1.2.16 | 346 | 3/23/2025 | |
| 1.2.15 | 316 | 3/23/2025 | |
| 1.2.14 | 312 | 3/23/2025 | |
| 1.2.13 | 209 | 3/23/2025 | |
| 1.2.12 | 204 | 3/23/2025 | |
| 1.2.11 | 203 | 3/23/2025 | |
| 1.2.10 | 211 | 3/23/2025 | |
| 1.2.0 | 106 | 3/22/2025 | |
| 1.1.99 | 309 | 3/22/2025 | |
| 1.1.98 | 300 | 3/21/2025 | |
| 1.1.97 | 379 | 3/18/2025 | |
| 1.1.96 | 364 | 3/18/2025 | |
| 1.1.95 | 362 | 3/18/2025 | |
| 1.1.94 | 332 | 3/14/2025 | |
| 1.1.93 | 388 | 3/11/2025 | |
| 1.1.92 | 388 | 3/11/2025 | |
| 1.1.91 | 394 | 3/10/2025 | |
| 1.1.9 | 372 | 3/10/2025 | |
| 1.1.8 | 460 | 3/7/2025 | |
| 1.1.7 | 382 | 3/2/2025 | |
| 1.1.6 | 320 | 3/2/2025 | |
| 1.1.5 | 341 | 3/2/2025 | |
| 1.1.4 | 338 | 3/2/2025 | |
| 1.1.3 | 310 | 3/2/2025 | |
| 1.1.2 | 348 | 3/1/2025 | |
| 1.1.1 | 340 | 2/28/2025 | |
| 1.1.0 | 317 | 2/28/2025 | |
| 1.0.99 | 340 | 2/26/2025 | |
| 1.0.98 | 322 | 2/26/2025 | |
| 1.0.97 | 330 | 2/25/2025 | |
| 1.0.96 | 324 | 2/25/2025 | |
| 1.0.95 | 334 | 2/24/2025 | |
| 1.0.94 | 347 | 2/24/2025 | |
| 1.0.93 | 311 | 2/24/2025 | |
| 1.0.92 | 341 | 2/23/2025 | |
| 1.0.91 | 342 | 2/19/2025 | |
| 1.0.9 | 337 | 2/18/2025 | |
| 1.0.7 | 327 | 2/15/2025 | |
| 1.0.6 | 318 | 2/15/2025 | |
| 1.0.5 | 329 | 2/15/2025 | |
| 1.0.4 | 336 | 2/15/2025 | |
| 1.0.3 | 297 | 2/15/2025 | |
| 1.0.2 | 311 | 2/12/2025 | |
| 1.0.1 | 350 | 2/9/2025 | |
| 1.0.0 | 336 | 2/9/2025 |