Floating Licenses
Floating / Concurrent Licenses
Floating licenses (also called concurrent licenses) let multiple users share a pool of seats. Instead of permanently consuming an activation slot, a user checks out a seat when the app starts and returns it when they close it.
Example: a company has 50 employees but only 10 ever use the software at the same time. You sell them a license with 10 concurrent seats — far cheaper than 50 individual activations.
Creating a floating license — toggle the Floating mode and set the maximum concurrent sessions.
New to this model? Start with the floating license guide and shared-seat example.
For cloned images and VDI, read the VM licensing guide. Checkout renews an existing session for the same license and device ID; distinct intended concurrent consumers need distinct provisioned identities. Copying an ID or session token is not a new independent seat.
How floating sessions work
| Action | API request | What happens |
|---|---|---|
| App starts | POST /api/v1/float/checkout | A session is created. If max concurrent seats are in use, returns an error — app should show "all seats in use". |
| Before expiresAt, normally every 4 min | POST /api/v1/float/heartbeat (body: {"sessionToken":"..."}) | Checks the current license and floating plan. Grants up to 15 minutes, capped at the license access deadline including applicable grace. Denied renewal grants no new authorization. |
| App closes | POST /api/v1/float/checkin (body: {"sessionToken":"..."}) | HTTP 204 confirms the seat was returned. A lost response does not confirm release. |
Creating a floating license
- Go to Licenses → Create
- Toggle "Floating / Concurrent License"
- Set Max Concurrent Sessions (blank = no license-specific cap; the plan's cap still applies)
- Generate and distribute the key as usual
SDK lifecycle: checkout, renewal and awaited return
All eight SDKs expose these operations. This .NET helper uses the actual 2.1.1 methods, cancels protected work when authority cannot be renewed, and awaits work stopping before returning the seat. Avoid async-void timers and ProcessExit handlers: the process does not await them.
This helper manages a floating lease. Before calling it, validate the key for your application using expectedProductId and provide the application version when using version rules; see license validation. Checkout itself does not carry those validation fields.
using System;
using System.Threading;
using System.Threading.Tasks;
using PermitCore;
namespace PermitCore.Examples;
public static class FloatingLeaseLifecycle
{
public static async Task RunAsync(PermitCoreClient client, string licenseKey,
Func<CancellationToken, Task> protectedWork, CancellationToken stop = default,
TimeSpan? heartbeatInterval = null)
{
var interval = heartbeatInterval ?? TimeSpan.FromMinutes(4);
if (interval <= TimeSpan.Zero || interval > TimeSpan.FromMinutes(4))
throw new ArgumentOutOfRangeException(nameof(heartbeatInterval));
var seat = await client.CheckoutAsync(licenseKey, ct: stop);
if (!seat.Success || string.IsNullOrWhiteSpace(seat.SessionToken))
throw new InvalidOperationException("No floating seat was granted.");
var token = seat.SessionToken;
using var lease = CancellationTokenSource.CreateLinkedTokenSource(stop);
Task? work = null;
try
{
var remaining = Remaining(seat);
lease.CancelAfter(remaining);
work = protectedWork(lease.Token);
while (!work.IsCompleted)
{
var pause = Task.Delay(remaining / 2 < interval ? remaining / 2 : interval, lease.Token);
if (await Task.WhenAny(work, pause) == work) break;
await pause;
var renewed = await client.HeartbeatAsync(token, lease.Token);
remaining = Remaining(renewed);
lease.Token.ThrowIfCancellationRequested();
lease.CancelAfter(remaining);
}
await work;
}
finally
{
lease.Cancel();
try
{
if (work is not null) await work;
}
catch (OperationCanceledException) when (lease.IsCancellationRequested) { }
finally
{
using var cleanup = new CancellationTokenSource(TimeSpan.FromSeconds(5));
if (!await client.TryCheckinAsync(token, cleanup.Token))
Console.Error.WriteLine("Seat return unconfirmed; the last granted deadline still applies.");
}
}
}
private static TimeSpan Remaining(FloatingSession session)
{
if (!session.Success || !session.ExpiresAt.HasValue)
throw new InvalidOperationException("Floating access could not be renewed.");
var remaining = session.ExpiresAt.Value.ToUniversalTime() - DateTime.UtcNow;
if (remaining <= TimeSpan.Zero)
throw new InvalidOperationException("The floating session deadline has passed.");
return remaining;
}
}Pass your application's work as protectedWork and use its cancellation token in every protected operation. Cancellation is cooperative: the helper cannot stop code that ignores that token. It waits for work to stop before returning the seat. A failed checkin is reported as unconfirmed.
Python uses checkout, heartbeat and try_checkin. Apply the same success/deadline and cooperative-cancellation rules; see the Python reference for its API and configuration. Keep session tokens out of URLs and logs.
Viewing active sessions
You can see all active sessions for a license via the API:
POST /api/v1/float/sessions (body: {"licenseKey":"..."}, requires authenticated access to the owning tenant — a license key is a sensitive credential).
Expired sessions no longer authorize use. Eligible checkout and session-list queries remove expired rows.