Named-user vs device seats in Keyright
A seat can mean a machine or a person, and the two count differently. Here is how to bind, enforce, and reconcile device seats and named-user seats in Keyright without overselling or locking out paying users.
Most licensing bugs are not cryptographic. They are a counting mismatch: you sold “five seats” meaning five people, and your enforcement counts five machines, so the sales engineer who also runs the app on a laptop and a VM burns three of the five seats by himself. Nobody attacked anything. The license simply counts a different noun than the one on the order form.
Keyright lets a seat mean either noun. This post is about choosing deliberately between the two, binding an activation to the right dimension, enforcing the ceiling against it, and — the part that trips teams up — reconciling the two models when you need to move from one to the other without locking out customers who did nothing wrong.
Two things a seat can mean
A seat is a unit of concurrent entitlement. The only real question is what consumes one.
Device seats
A device seat is bound to a machine. The SDK computes a stable machine fingerprint at activation, the issuing service records it, and the license’s seat ceiling is enforced against the count of distinct fingerprints. Five device seats means at most five machines ever hold a live activation at once. This is the right model for shared workstations, kiosks, build agents, and anything where “who is sitting there” is irrelevant — you are licensing the installation, not the human.
The failure mode is the power user with three devices. Under device seats he is three seats, and if your price list said “per user” you are now short two seats for the same money.
Named-user seats
A named-user seat is bound to an identity — an email, an SSO subject, an employee id — carried into activation as a stable user reference. The seat ceiling is enforced against the count of distinct identities, and each identity may activate on as many of their own devices as the license allows. Five named-user seats means five people, each on their laptop, desktop, and VM, with no extra charge. This matches how most B2B software is actually sold.
Its failure mode is the shared login: if ten people activate under one ops@acme.example, you count one seat and lose nine. Named-user seats are only honest when the identity is one the customer cannot trivially share — an SSO subject, not a shared mailbox.
Binding an activation to the right dimension
The SDK is initialized the same way for both models — the difference is what you attach to the activation. For a self-hosted deployment you point the client at your issuing service and pin the public key the licenses are signed with:
var keyright = new KeyrightClient(new KeyrightOptions
{
Product = "acme-suite",
PublicKeyBase64 = EmbeddedPublicKey, // pins who you trust to sign
ServiceUrl = "https://license.acme.example" // your self-hosted instance
});
For a device-seat product you activate with the machine fingerprint only. The SDK derives it from stable hardware and OS signals; you do not compute it by hand.
// Device-locked: the seat is the machine. No identity is sent.
var result = await keyright.ActivateAsync(licenseKey);
if (result.Status == ActivationStatus.SeatsExhausted)
ShowUpgradePrompt(result.SeatsUsed, result.SeatCeiling);
For a named-user product you also pass a stable user reference. Make it the most tamper-resistant identity you have — an SSO subject (sub) claim is ideal, because the customer’s own IdP vouches for it and a user cannot mint a second one to dodge the count.
// Named-user: the seat is the person. Fingerprint still travels for device limits.
var result = await keyright.ActivateAsync(licenseKey, new ActivationContext
{
UserRef = currentUser.Subject // e.g. the OIDC "sub" claim
});
The fingerprint still rides along on a named-user activation, which is what lets you cap devices per user (say, “named-user, up to 5 devices each”) — a second ceiling the issuing service enforces independently of the user count. Sending both bindings on every activation is also what makes the migration below painless: an activation that carries both can be counted either way.
Enforcing the ceiling in the right place
Seat counting is a server-side decision — a client cannot be trusted to count its own population — but the licensed app still must gate features locally and fail closed. The two jobs split cleanly.
The issuing service owns the count. When an activation arrives, it projects the request onto the license’s configured dimension and compares to the ceiling. In pseudocode the rule is the same for both models; only the key changes:
// Inside the issuing service, simplified.
string seatKey = license.SeatModel switch
{
SeatModel.Device => request.Fingerprint, // one seat per machine
SeatModel.NamedUser => request.UserRef // one seat per identity
?? throw new MissingUserRefException(), // named-user needs an identity
_ => throw new UnreachableException()
};
var distinct = await _seats.CountDistinctAsync(license.Id, license.SeatModel);
bool alreadyHeld = await _seats.HoldsAsync(license.Id, seatKey);
if (!alreadyHeld && distinct >= license.SeatCeiling)
return ActivationResult.SeatsExhausted(distinct, license.SeatCeiling);
await _seats.UpsertAsync(license.Id, seatKey, request.Fingerprint);
Notice that re-activating an identity (or a machine) that already holds a seat is idempotent: alreadyHeld short-circuits the ceiling check, so Alice adding her third laptop under named-user seats never trips “seats exhausted,” while a sixth distinct person does.
The app, meanwhile, never counts anything. It validates the signed license it holds and gates on the entitlements, fail-closed, so a network blip can never silently unlock a feature:
var info = await keyright.ValidateAsync();
if (!info.IsValid || !info.Entitlements.Has("reporting"))
throw new FeatureLockedException("reporting"); // local, offline-safe, every time
Reconciling device seats into named-user seats
The hard migration is device-to-named-user, because the counts are not interchangeable and a careless flip either oversells (you grant one seat per device, now free) or locks out (you grant one seat per user but some users suddenly exceed their old device count). The safe path is three ordered steps, and the first one buys you time.
1. Start carrying the identity before you change the model. Ship a release that sends UserRef on activation while the license still counts devices. Nothing changes for the customer, but every new activation now records which person owns each machine. Let this soak until most live activations carry an identity.
2. Reconcile, then size the new license. Group the recorded device activations by their UserRef. Each group is one future named-user seat; the group size tells you how many devices that user runs. The count of groups is the number of named-user seats the customer actually needs — which is almost always fewer than their device count, and that is the selling point of the switch.
// Collapse device activations into named-user seats.
var seatsNeeded = activations
.Where(a => a.UserRef is not null)
.GroupBy(a => a.UserRef)
.Select(g => new NamedUserSeat(g.Key!, devices: g.Count()))
.ToList();
int newCeiling = seatsNeeded.Count; // people, not machines
int maxDevices = seatsNeeded.Max(s => s.Devices); // size the per-user device cap
3. Issue a new license counting users, sized to the reconciliation. Set the ceiling to newCeiling (plus any headroom you sell) and the per-user device cap to at least maxDevices so no existing user is retroactively over the limit. Because in-field apps validate against the signed license they will receive, the switch is invisible to them: they keep running, the issuing service simply starts counting a different noun. Activations that never reported a UserRef are your cleanup list — stale machines to let expire, or users to chase for an identity.
The reverse migration, named-user back to device, is simpler and rarely wanted: every distinct fingerprint already present becomes a device seat, so you only need a ceiling at least as large as the current distinct-device count.
Pick the noun, then count it
Everything here reduces to one discipline: decide whether a seat is a machine or a person before you price the license, bind the activation to exactly that noun, and let the issuing service count that one dimension. Device seats for installations, named-user seats for people, and a stable identity you cannot share when it is people. Carry both bindings on every activation and the model becomes a server-side setting you can change — with a reconciliation pass — instead of a decision frozen into your field population.
Both seat models run on self-hosted Keyright, including the free Community Edition for a single product and a modest license count; multi-product fleets and larger seat pools are an upgrade to a paid self-license. Either way the counting rule is the same, and the only thing that ever locks out a paying user is binding a seat to the wrong noun.
Try Nebula.NET
Harden your .NET code in minutes — start with the free edition.