Authlink.Webhooks 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Authlink.Webhooks --version 1.3.0
                    
NuGet\Install-Package Authlink.Webhooks -Version 1.3.0
                    
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="Authlink.Webhooks" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Authlink.Webhooks" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Authlink.Webhooks" />
                    
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 Authlink.Webhooks --version 1.3.0
                    
#r "nuget: Authlink.Webhooks, 1.3.0"
                    
#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 Authlink.Webhooks@1.3.0
                    
#: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=Authlink.Webhooks&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Authlink.Webhooks&version=1.3.0
                    
Install as a Cake Tool

Authlink.Webhooks

Webhook signature validation and event parsing for Authlink webhook integration.

Installation

dotnet add package Authlink.Webhooks

Quick Start

Register services in your application:

using Authlink.Webhooks.Extensions;

// In Program.cs or Startup.cs
services.AddAuthlinkWebhooks();

Usage

Parsing and Validating Webhook Events

using Authlink.Webhooks.Core.Abstractions;
using Authlink.Webhooks.Core.Payloads;

public class WebhookController : ControllerBase
{
    private readonly IWebhookEventParser _parser;

    public WebhookController(IWebhookEventParser parser)
    {
        _parser = parser;
    }

    [HttpPost]
    public async Task<IActionResult> HandleWebhook()
    {
        using var reader = new StreamReader(Request.Body);
        var payload = await reader.ReadToEndAsync();

        var signature = Request.Headers["X-Webhook-Signature"].ToString();
        var timestamp = Request.Headers["X-Webhook-Timestamp"].ToString();
        var secret = Configuration["Webhook:Secret"];

        var result = _parser.ParseAndValidate<RegistrationCompletingPayload>(
            payload, signature, timestamp, secret);

        if (!result.IsSuccess)
        {
            return Unauthorized(result.Error);
        }

        var webhookEvent = result.Event!;
        // Process the event...

        return Ok(WebhookResponseBuilder.Approve());
    }
}

Basic Signature Validation

using Authlink.Webhooks.Core.Abstractions;

public class WebhookHandler
{
    private readonly IWebhookSignatureValidator _validator;

    public WebhookHandler(IWebhookSignatureValidator validator)
    {
        _validator = validator;
    }

    public bool ValidateRequest(string payload, string signature, string timestamp, string secret)
    {
        return _validator.ValidateSignature(payload, signature, timestamp, secret);
    }
}

Parsing Without Validation

using Authlink.Webhooks.Core.Abstractions;
using Authlink.Webhooks.Core.Payloads;

// Parse without signature validation (use with caution)
var result = _parser.Parse<RegistrationCompletingPayload>(jsonPayload);

if (result.IsSuccess)
{
    var webhookEvent = result.Event!;
    Console.WriteLine($"Event Type: {webhookEvent.EventType}");
    Console.WriteLine($"Event ID: {webhookEvent.EventId}");
}

Registration Event Payloads

registration.completing (blocking: approve/reject)

Field Type Notes
registrationSessionId guid Correlates with the later registration.completed event.
email, phoneNumber, username, firstName, lastName string? Absent on the existing_user branch — those steps are skipped. phoneNumber is always canonical E.164.
phoneCountryIso2 string? The ISO 3166-1 alpha-2 country the registrant explicitly selected to validate phoneNumber against. Not the identity document's country — that is countryIso2. Absent when no phone country was reliably determined (international-format input without a selection, the existing_user branch, or older Authlink servers).
countryIso2, identifierKind, identifierValue string? / enum? The submitted government identifier, when provided. countryIso2 is the identity document's country, independent of phoneCountryIso2.
enrollmentType string new_user or existing_user. Absent from events produced by older Authlink servers (treat as new_user).
existingUserId guid? The matched Authlink user on the existing_user branch; absent otherwise.

registration.completed (non-blocking notification)

Field Type Notes
registrationSessionId guid Correlates with the earlier registration.completing event.
userId guid The Authlink user created or reused.
clientId guid The client the registration was performed for.
completedAt datetime UTC completion timestamp.
enrollmentType string new_user, existing_user or already_member. Absent from events produced by older Authlink servers (treat as new_user).

The three outcomes

enrollmentType What happened registration.completing What your application should do
new_user A new Authlink user was created and enrolled. Sent (blocking) Create the local account for userId.
existing_user An already-onboarded user proved ownership of their account and was enrolled with a new client membership. Sent (blocking, with existingUserId) Link your existing customer record to userId.
already_member The user already held the membership — nothing was provisioned and no invitation-code use was consumed. Not sent — there is nothing to approve Reconcile the duplicate invite: re-link userId, which your system most likely lost track of when it sent the invite.

Both fields are additive: the event types, envelope, signing, and retry schedule are unchanged, and unknown fields can be safely ignored by subscribers that do not need them.

Security

  • Uses HMAC-SHA256 for signature computation
  • Constant-time comparison to prevent timing attacks
  • Signature format: sha256={hex_hash}
  • Supports timestamp validation for replay attack prevention
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 (2)

Showing the top 2 NuGet packages that depend on Authlink.Webhooks:

Package Downloads
Authlink.Webhooks.ServiceStack

ServiceStack integration for Authlink webhook handling with automatic signature validation.

Authlink.Webhooks.AspNetCore

ASP.NET Core integration for Authlink webhook handling

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.0 536 10/23/2026
1.3.1 139 10/2/2026
1.3.0 428 9/16/2026
1.2.0 165 9/7/2026
1.1.0 464 7/24/2026
1.0.3 237 3/13/2026
1.0.2 173 3/13/2026
1.0.1 181 3/12/2026
1.0.0 174 3/6/2026