Skip to content

Run modes and connectors

Choose how a site runs in Settings > Connectors, or with OG_KEYSTONE_RUN_AS in wp-config.php.

Mode Use it when
standalone (default) One WordPress site does everything: sells, issues licences and answers licence checks.
server This installation holds the licences, memberships and credit, and accepts signed calls from your stores.
connector This site is a WooCommerce store. Licences, memberships and credit live on a separate licence server.

OG Nexus itself runs as a connector store against a dedicated licence server, so the server stays private and only a small public surface is exposed to plugins.

Store side (connector mode)

Set these in wp-config.php (never in the database):

define('OG_KEYSTONE_SERVER_URL', 'https://licence-server.example/og-keystone/v1');
define('OG_KEYSTONE_CONNECTOR_KEY', 'ogkc_...');
define('OG_KEYSTONE_CONNECTOR_SECRET', 'ogks_...');

The /og-keystone/v1 suffix is required on a dedicated server. Behaviour in connector mode:

  • Product choices on the WooCommerce product panel come from the server's catalogue.
  • Paid and refunded orders go through a retry queue that backs off over 48 hours (1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 12 h, 15 h 15 m). A temporary outage never loses an order.
  • The customer portal and [ogk_restricted] call the server for the signed-in, email-confirmed customer. Access answers are cached for 60 seconds.
  • If the server cannot be reached the store's /my routes answer 503 ("Your account is temporarily unavailable. Please try again shortly.") and access checks fail closed.
  • Standalone behaviour is untouched until a site has been a connector once.

Server side: creating a connector

A connector is one store that may talk to the server. You get a key id (ogkc_ plus 12 hex characters) and a secret (ogks_ plus 64 hex characters). The secret is shown once, so copy it straight into the store's wp-config.php.

  • On a WordPress server: Settings > Connectors (needs OG_KEYSTONE_ENC_KEY, because the secret is stored encrypted).
  • On the dedicated licence server, an administrator uses the ogk command: ogk connector:create "<name>" catalogue,orders <allowed address>, ogk connector:list, ogk connector:revoke <id>.

Choose the scopes it may use: catalogue (read products and tiers), orders (fulfil and revoke) and customer (portal reads and changes). Optionally limit the addresses it may be used from. A connector can be revoked at any time and stops working at once. Never email or chat a secret.

How requests are signed

Every request carries four headers:

Header Value
X-OGK-Key the key id
X-OGK-Timestamp Unix seconds, within 5 minutes of the server clock
X-OGK-Nonce 16 to 64 hex characters, never reused
X-OGK-Signature lower-case hex HMAC-SHA256 with the secret of: method, route path (and sorted query), timestamp, nonce, SHA-256 of the body, each on its own line

The server refuses a request that is too old, too new, wrongly signed, tampered, a replay, from a revoked key, from an address outside the allow-list, or outside the key's scopes. A wrong key id and a wrong secret get the same answer so nobody can discover which ids exist.

Checking it works

Use Settings > Connectors > Ping (or the GET /connector/ping route). A good result confirms the key, the address and the clock. If it fails, see Troubleshooting.

Connector routes

Route Scope Purpose
GET /connector/ping any Proves key, address and clock.
GET /connector/catalogue catalogue Products, tiers and plans a product can use.
POST /connector/orders/fulfil orders A paid order: issues licences, grants membership, adds credit. Idempotent.
POST /connector/orders/revoke orders A refunded or cancelled order.
GET /connector/my/* customer A customer's memberships, subscriptions, credits, licences, sites, downloads and access.
POST /connector/my/... customer Download links, site deactivation, showing a key, pausing, resuming and cancelling.

Every call is logged with the actor connector:<name>. The secret is never logged.