Linbik.Server 1.2.8

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

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 Ed25519 PublicKey
  • [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-scheme RequireApplicationToken flag 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

// 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 PublicKey is left empty, AddLinbikServer logs 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

πŸ“„ 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 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. 
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.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
Loading failed