Skip to content
Oclavex is in private preview, open to existing MonetizeIt users. New users who would like to evaluate Oclavex before the public launch can request access at info@revenusion.com.

.NET SDK — device fingerprints

Activation binds a seat to a device fingerprint — a stable identifier for the install. The fingerprint is what lets the platform tell “the same machine reconnecting” from “a new machine claiming a seat”, so a restart or redeploy reuses its seat instead of consuming a new one.

Seats are counted per fingerprint. If the fingerprint changes between runs, each run looks like a new device: the entitlement fills up and further activations are refused. A fingerprint that stays constant across process restarts is therefore the single most important property — prefer a value you can guarantee is stable over one derived from volatile hardware.

The SDK resolves it through INodeIdProvider:

  • From configuration — the default provider reads Oclavex:LicenseConsumer:NodeId. Set it to a value that is stable for the install (for example, a per-deployment id you persist).
  • Derived from the device — in a hosted app with no node id configured, the default is a hash of the machine name and the application name. DeviceNodeId (below) reads the operating system’s machine id, the machine name and the network adapter instead. The SDK skips virtual and VPN adapters, but a physical adapter that comes and goes (a USB dock, for example) still changes that one trait.

Every INodeIdProvider gives the device as a set of named components, and the fingerprint is derived from that set:

  • One component is its own fingerprint. A value you supply, such as a deployment id, is one component, so the fingerprint is that value, readable in the license and the portal.
  • Two or more components are combined into one digest: each written as name=value, sorted by name, joined with line feeds (\n), hashed with SHA-256 and encoded Base64Url.

The SDK sends the components and the fingerprint with every activation, online and offline. The server computes the same digest and refuses an activation whose fingerprint does not match its components. A request that carries a fingerprint and no components is read as a single component, so a hand-built HTTP call and the SDK land on the same seat for the same value.

DeviceNodeId takes one component per device trait and hashes each on the device — raw values never leave the machine. Pass it to UseNodeId on the fluent builder, or register it as the INodeIdProvider:

var fingerprint = new DeviceNodeId(
FingerprintMethods.MachineId | FingerprintMethods.MachineName | FingerprintMethods.MacAddress);

DeviceNodeId uses these three traits when you pass none. Available traits:

Trait What the SDK reads
MachineId The machine id the operating system keeps: the MachineGuid on Windows, /etc/machine-id on Linux, the platform UUID on macOS. It stays the same through a network card swap, a rename and an OS upgrade.
MachineName The machine’s network name.
MacAddress The MAC address of one physical network adapter.
OsVersion The operating system version.
UserName The account the process runs under.

Each component is hashed with its trait name and a version tag, so the same value under two traits gives two different hashes. A trait the machine does not have (no physical adapter, a container without a machine id) is left out. If none of the selected traits yields a value, the machine name is used, so the provider always returns at least one component.

MacAddress picks one adapter and holds it for the life of the process. The choice ignores loopback, tunnel and dial-up adapters and the usual virtual ones, and does not depend on enumeration order, so a VPN or container adapter coming up mid-session does not change the fingerprint underneath a running install.

With a license store, the SDK keeps the first set of components it computed beside the store and presents that set on later runs, so a laptop that starts off its dock is still the device its stored license names.

When the license names a fingerprinting method

Section titled “When the license names a fingerprinting method”

A license’s options can name the traits a fingerprint must be taken from, such as MachineName, MacAddress (the fingerprintingMethod of its license options; the default, Any, accepts every fingerprint). DeviceNodeId sends the traits it combined with each activation, online and offline, and the server refuses one taken from a different set of traits. A fingerprint you supply yourself names no traits, so such a license refuses it: use DeviceNodeId with the same traits, or leave the method at Any. The check runs on every activation, so setting a method on a license that devices already use holds those devices to it from their next activation.

For a value you control — a tenant id, a provisioned device id, a stored GUID — register a scoped INodeIdProvider before AddOclavexLicenseConsumer:

builder.Services.AddScoped<INodeIdProvider>(_ =>
StaticNodeId.Create(deploymentId));

In a multi-tenant host, resolve the fingerprint from the current tenant so each tenant’s seats are counted independently — pair this with the per-tenant IActivationCodeProvider from install and configure.

A provider you write yourself returns its components and a NodeId that is FingerprintDigest.Compute(Components); for a single value, return FingerprintDigest.Single(value) as the components.

Short fingerprints for manual / air-gapped entry

Section titled “Short fingerprints for manual / air-gapped entry”

A hashed fingerprint is normally moved as a file or an API call, not typed by hand. When the only channel available is a person reading a value off one screen and entering it on another — a fully air-gapped machine, a value read aloud over the phone — a 40+ character hash is impractical. StaticNodeId.CreateShort produces a short, grouped alternative instead:

builder.Services.AddScoped<INodeIdProvider>(_ =>
StaticNodeId.CreateShort(deploymentId));

The result looks like 7K4M-QX2P-9J — an 8-character payload grouped for readability plus a 2-character checksum, so a mistyped fingerprint is rejected rather than silently activating the wrong device.

If you build your own entry box for that value, check it with TryCanonicalize and send back what it gives you:

if (!ShortFingerprintSigner.Instance.TryCanonicalize(typed, out var fingerprint))
return "That is not a valid device fingerprint.";

It accepts any case and any separators, and forgives the look-alike substitutions people most often make copying a code by hand (O/0, I/L/1) — the same tolerance an activation code has. What it returns is the exact value CreateShort produced. Send that, not what was typed: a single-component fingerprint is matched by exact equality. If the application sends the typed text, TryCanonicalize still succeeds, but the server sees a different fingerprint.

A device whose traits change, such as a swapped network card or a renamed machine, presents a different set of components. The entitlement decides whether that device keeps its seat:

Strategy A returning device keeps its seat when
MatchAll all its components are unchanged. This is the default.
MatchAny at least one component is unchanged
MatchTwo at least two components are unchanged, or the only one when the device registered only one
MatchMost more than half of the components it registered are unchanged

When a tolerant strategy keeps the seat for a changed device, the server re-binds the session to the device as it is now: it stores the new components, and the license it issues names the new fingerprint. The next change is measured from that state, so a network card swap this month and a rename next month each keep the seat under MatchMost. A session re-binds at most once in 24 hours; a second change within that time is treated as a new device, which takes a seat of its own or is refused when none is free. Each re-bind is recorded in the audit log with the old and the new fingerprint.

How much a strategy can forgive depends on how many components the application reports. With one component, every strategy needs that one unchanged, so a supplied fingerprint is always matched exactly. With the default three traits, MatchTwo and MatchMost keep the seat after one change, and treat the device as new after two changes at once.

MatchAny is only as strong as the weakest trait. A common machine name or an OS version is the same on many machines, and the hashes carry no secret, so two different machines can share one component. Use MatchAny only with traits that are rare across your customers’ devices.

In the portal, open an entitlement and go to the Rules tab. The setting is Fingerprint component matching. On the Activations list, the Fingerprint components and Seat moved columns show which components a session registered and when its seat last moved. Both columns are hidden by default; turn them on in the column picker.

These errors refuse an activation because of the fingerprint:

  • “A device fingerprint is required to activate this license.” — the code requires the device to identify itself and the request carried no fingerprint. Check that your INodeIdProvider is returning a value.
  • “This activation code is locked to a different device.” — the code is bound to one machine’s fingerprint and this is not that machine. The lock compares the fingerprint exactly, whatever the entitlement’s matching strategy. If it should be the same machine, the bound value on the code needs updating; a fingerprint that changed on its own points at an unstable provider, which why stability matters covers.
  • “The fingerprint is not the digest of the components sent with it.” — a custom provider or HTTP client sent a fingerprint that is not derived from its components. Return FingerprintDigest.Compute(Components) as the NodeId, or leave the fingerprint out.

The first two come from rules on the activation code, set up as described in Locking a code to one device.

Where hardware traits are meaningless (containers, autoscaling), derive a stable logical fingerprint instead:

using Revenusion.Oclavex.Client.LicenseConsumer;
builder.Services.AddScoped<INodeIdProvider>(_ =>
StaticNodeId.Create(customerIdentifier));

Same identifier, same fingerprint — one seat per customer environment across restarts and instances.