Linbik.Server
1.2.8
dotnet add package Linbik.Server --version 1.2.8
NuGet\Install-Package Linbik.Server -Version 1.2.8
<PackageReference Include="Linbik.Server" Version="1.2.8" />
<PackageVersion Include="Linbik.Server" Version="1.2.8" />
<PackageReference Include="Linbik.Server" />
paket add Linbik.Server --version 1.2.8
#r "nuget: Linbik.Server, 1.2.8"
#:package Linbik.Server@1.2.8
#addin nuget:?package=Linbik.Server&version=1.2.8
#tool nuget:?package=Linbik.Server&version=1.2.8
Linbik.Server
Integration service package for Linbik Framework. Provides PASETO v4.public (Ed25519) validation middleware, dual authentication schemes (delegated user context + application/service-to-service), integration lifecycle handlers, telemetry, and health checks.
π¦ Installation
dotnet add package Linbik.Server
π Features
- Dual PASETO Authentication Schemes β
LinbikDelegated(LinbikDefaults.DelegatedScheme, user context) +LinbikApplication(LinbikDefaults.ApplicationScheme, machine/service-to-service context), both validated against the same Ed25519PublicKey - [LinbikDelegatedAuthorize] β attribute for user-context endpoints (rejects application tokens)
- [LinbikApplicationAuthorize] β attribute for application/service-to-service endpoints, with optional role-based access (rejects user tokens)
- Cross-Scheme Injection Protection β
PasetoBearerHandler's per-schemeRequireApplicationTokenflag prevents token misuse between schemes - ILinbikIntegrationHandler β Integration lifecycle events (created, removed, toggled, admin changed)
- OpenTelemetry β Built-in telemetry with
AddLinbikTelemetry() - Health Checks β Service health monitoring with
AddLinbikHealthChecks()
π§ Configuration
Fluent Builder (Recommended)
// In Program.cs
builder.Services.AddLinbik()
.AddLinbikServer();
var app = builder.Build();
app.EnsureLinbik();
app.UseAuthentication();
app.UseAuthorization();
Standalone Setup
builder.Services.AddLinbikServer(options =>
{
options.PublicKey = builder.Configuration["Linbik:PublicKey"]!; // Ed25519 public key (Base64), from Linbik platform
options.PackageName = "payment-gateway"; // used for audience validation
});
If
PublicKeyis left empty,AddLinbikServerlogs a warning and skips authentication scheme registration entirely β delegated and application token validation will be disabled.
π» Usage
Protecting Endpoints
[ApiController]
[Route("api/integration")]
public class IntegrationController : ControllerBase
{
// User-context endpoint (requires delegated PASETO token)
[LinbikDelegatedAuthorize]
[HttpPost("charge")]
public IActionResult Charge([FromBody] ChargeRequest request)
{
var userId = HttpContext.User.FindFirst("sub")?.Value;
return Ok();
}
// Application endpoint β any application/service-to-service token accepted
[LinbikApplicationAuthorize]
[HttpPost("app/sync")]
public IActionResult SyncData() => Ok();
// Application endpoint β only service-to-service tokens (role=Service)
[LinbikApplicationAuthorize("Service")]
[HttpPost("app/webhook/{eventType}")]
public IActionResult AppWebhook(string eventType) => Ok();
// Application endpoint β only platform tokens (role=Linbik)
[LinbikApplicationAuthorize("Linbik")]
[HttpPost("app/platform-event")]
public IActionResult OnPlatformEvent() => Ok();
}
Reading Claims
PasetoBearerHandler builds the ClaimsPrincipal directly from the token's raw claim keys (e.g. sub, name, preferred_username, azp, role) β they are not mapped to System.Security.Claims.ClaimTypes constants:
var userId = HttpContext.User.FindFirst("sub")?.Value;
var username = HttpContext.User.FindFirst("preferred_username")?.Value;
var isAuthenticated = HttpContext.User.Identity?.IsAuthenticated ?? false;
var roles = HttpContext.User.FindAll("role").Select(c => c.Value);
π Integration Lifecycle Handler
Handle events when main services create/remove/toggle integrations with your service:
public class MyIntegrationHandler : ILinbikIntegrationHandler
{
public Task<IntegrationEventResult> OnIntegrationCreatedAsync(IntegrationEvent e)
{
// A new service wants to use our integration
return Task.FromResult(IntegrationEventResult.Success());
}
public Task<IntegrationEventResult> OnIntegrationRemovedAsync(IntegrationEvent e)
=> Task.FromResult(IntegrationEventResult.Success());
public Task<IntegrationEventResult> OnIntegrationToggledAsync(IntegrationEvent e)
=> Task.FromResult(IntegrationEventResult.Success());
public Task<IntegrationEventResult> OnIntegrationAdminChangedAsync(IntegrationEvent e)
=> Task.FromResult(IntegrationEventResult.Success());
}
Register:
// With custom handler
builder.Services.AddLinbikIntegrationHandler<MyIntegrationHandler>();
// Or default (no-op) handler
builder.Services.AddLinbikIntegrationHandler();
// Map integration endpoints
app.MapLinbikIntegrationEndpoints();
π Telemetry (OpenTelemetry)
// Add OpenTelemetry tracing and metrics
builder.Services.AddLinbikTelemetry(options =>
{
options.ServiceName = "payment-gateway";
options.EnableConsoleExporter = true;
});
π₯ Health Checks
builder.Services.AddLinbikHealthChecks();
app.UseLinbikHealthChecks();
π Documentation
- Full Documentation
- Examples
- Linbik.Core
- Linbik.JwtAuthManager
- Linbik.PasetoAuthManager
- Linbik.YARP
- Linbik.Slices
π License
MIT License
Contact: info@linbik.com
Version: 1.2.0
Platform: ASP.NET Core 10.0 (net10.0)
Last Updated: 9 EylΓΌl 2026
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Linbik.Core (>= 1.2.8)
- OpenTelemetry.Exporter.Console (>= 1.18.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.18.0)
- OpenTelemetry.Extensions.Hosting (>= 1.18.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.18.0)
- OpenTelemetry.Instrumentation.Http (>= 1.18.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.18.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.2.8 | 118 | 9/20/2026 |
| 1.2.7 | 119 | 9/10/2026 |
| 1.2.5 | 130 | 9/7/2026 |
| 1.2.3 | 231 | 9/1/2026 |
| 1.2.1 | 145 | 7/16/2026 |
| 1.2.0-preview.3 | 78 | 5/30/2026 |
| 1.2.0-preview.2 | 90 | 4/26/2026 |
| 1.2.0-preview.1 | 106 | 4/2/2026 |
| 1.1.0 | 417 | 12/5/2025 |
| 1.1.0-beta0007 | 116 | 3/6/2026 |
| 1.0.7 | 166 | 3/6/2026 |
| 1.0.1 | 250 | 12/14/2025 |
| 1.0.0 | 116 | 3/6/2026 |
| 0.60.1 | 123 | 3/6/2026 |
| 0.46.0 | 384 | 11/30/2025 |
| 0.45.12 | 380 | 11/30/2025 |
| 0.45.7 | 255 | 8/31/2025 |
| 0.45.6 | 236 | 8/31/2025 |
| 0.45.5 | 258 | 8/27/2025 |
| 0.44.0 | 269 | 8/24/2025 |