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.

Authentication

Oclavex has two credential models, and knowing which one a call uses removes most integration confusion:

Model Who holds it Authenticates
OAuth client credentials Your backend / back-office code admin/* and operational/* endpoints — catalog authoring, entitlement management, code issuance, reporting
Activation code + device fingerprint → license session token Your shipped application The runtime surface — activation, session renew/check-in/release, usage reporting

Your backend is a trusted server and identifies itself with a secret. Your shipped application is not — it never carries an API secret; it earns a signed license token by presenting an activation code and a device fingerprint.

Your backend trusted server, holds a secret Client credentials exchange id + secret for a bearer token Back-office API catalog & entitlements, codes & reports Your shipped app untrusted, carries no secret License session token earned with activation code + fingerprint Runtime API activate & renew, report & meter usage

Register a client in the portal under Settings → API credentials (guide). The secret is shown once at creation; grant the client only the scopes it needs.

Exchange the id and secret for a token, then carry it as a bearer. Ask for the scopes the token needs: it carries only the scopes the request asks for, capped to those registered on the client, so a request that omits scope yields a token that is refused by every admin/* endpoint. api.example.com stands in for your tenant endpoint — replace it with your own host.

Terminal window
curl -X POST https://api.example.com/auth/connect/token \
-d grant_type=client_credentials \
-d client_id=$ID -d client_secret=$SECRET \
-d scope="provision.product.* provision.entitlement.*"
Terminal window
curl https://api.example.com/api/v1/provision/admin/products \
-H "authorization: Bearer $TOKEN"

Tokens are short-lived — cache one and refresh on expiry rather than requesting per call. Scopes may use wildcards and are checked per HTTP verb; the catalog is in Auth & scopes.

The activation endpoints are anonymous — no bearer token needed:

Terminal window
curl -X POST https://api.example.com/api/v1/provision/activations/jwt \
-H "content-type: application/json" \
-d '{ "activationCode": "ABC123-DEF456-GHI789", "fingerprint": "device-fingerprint-hash" }'

The response is a signed JWT — the license itself. It authenticates every session-scoped call that follows, on the session it names: POST /activations/renew, /check-in, /release, and the usage endpoints.

Use POST /activations/license instead of /jwt when the client also needs the metadata: the entitlement description and license terms link, the licensed products with the custom properties you marked Public, and each feature’s name and description.

When your application has a signed-in user (a SaaS app, a portal), set useInteractiveUser: true on the activation request and send the user’s token. The server resolves entitlements assigned to that user; the activation code becomes optional when the user has exactly one. This is how you license per-user without distributing codes at all — assign the entitlement to the user and let sign-in do the rest. The same assignment powers the end-user portal, where users see and activate their licenses themselves.

The SDK abstracts both models behind IAuthenticationProvider. Two ready-made providers ship in Revenusion.Oclavex.HttpConnector, which every app gets with Client.LicenseConsumer.Connected, so they work on every target the SDK supports, .NET Framework and .NET 8 included:

  • ClientCredentialsAuthentication — the backend model: discovers the token endpoint, requests and caches tokens, refreshes on expiry. Its constructor takes an HttpClient, the client ID, the secret and the scopes. That HttpClient points at your tenant’s sign-in authority, https://<tenant host>/auth/, which Settings → Connect your app shows as Sign-in authority. Given the tenant’s own address instead, the first call fails with “Discovery document request failed”.
  • AnonymousAuthentication — for the activation calls themselves. On the session-scoped calls after activation, the SDK presents the license session token itself.

Two more providers, for an app that runs in a host, ship in Revenusion.Oclavex.Client.AspNetCore, which targets .NET 10 only:

  • BearerTokenLicenseApiAuthentication — inbound-token pass-through: forwards the Authorization bearer token of the host’s current HTTP request. It does not carry the license session token.
  • LicenseSessionTokenAuthenticationProvider — the runtime model in a hosted app: register it with AddLicenseSessionTokenSink and the SDK sends the license session token on session-scoped calls.

LicenseClientBuilder.UseInteractiveUserActivation() switches the .NET SDK to interactive-user activation.

If you bring your own IAuthenticationProvider, implement ILicenseTokenSink on it. The SDK calls SetLicenseToken with the license session token after every successful activation, renewal and borrow, so your provider can present that token on session-scoped calls without extra code to pass it around.

Before every activation the SDK calls ClearLicenseToken. Your provider must then forget the session token and send your application’s own credential again: an activation is authorized by your application, and the token your provider held belongs to the session served last, which may be the session the server has just rejected.

  • Client secrets stay on your servers. Never embed one in a desktop or mobile build — that’s what the license-session model is for.
  • License tokens are bearer credentials for the session; don’t log them.
  • Rotation and storage guidance is in Credentials & secrets.