Catalog & commerce

OAuth clients

Registering clients, the three profiles, redirect URI rules, resource allow-lists and rotating a secret.

A client is what actually talks to the identity provider. It lives under one application, and that binding is not cosmetic: an unbound service client is refused with app_not_bound.

Register one

create client
curl -X POST \
  https://apps-api.versified.com.gh/appcenter/v3/admin/apps/42/oauth-clients \
  -H "Authorization: Bearer $APPCENTER_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "clientId": "ledgerly-web",
    "name": "Ledgerly web",
    "profile": "confidential_web",
    "redirectUris": ["https://app.ledgerly.com/api/auth/callback"],
    "postLogoutRedirectUris": ["https://app.ledgerly.com"],
    "resources": ["urn:versified:api:appcenter"]
  }'

A secret-bearing profile answers with secret — 64 hex characters, returned once. A public_pkce client answers hasSecret: false instead.

200 OK — the registered client
{
  "success": true,
  "data": {
    "client": {
      "clientId": "ledgerly-web",
      "appId": 42,
      "appName": "Ledgerly",
      "profile": "confidential_web",
      "profileLabel": "Confidential web",
      "profileSource": "stored",
      "name": "Ledgerly web",
      "redirectUris": ["https://app.ledgerly.com/api/auth/callback"],
      "postLogoutRedirectUris": ["https://app.ledgerly.com"],
      "grantTypes": ["authorization_code", "refresh_token"],
      "responseTypes": ["code"],
      "tokenEndpointAuthMethod": "client_secret_basic",
      "scopes": ["openid", "email", "profile", "offline_access", "appcenter"],
      "resources": ["urn:versified:api:appcenter"],
      "trusted": false,
      "logoutScope": "client",
      "active": true,
      "version": 1,
      "hasSecret": true,
      "secretUpdatedAt": "2026-11-08T09:31:02.004Z",
      "secretUpdatedByEmail": "ops@versified.com.gh",
      "createdByEmail": "ops@versified.com.gh",
      "updatedByEmail": null,
      "createdAt": "2026-11-08T09:31:02.004Z",
      "updatedAt": "2026-11-08T09:31:02.004Z",
      "needsAssignment": false,
      "editable": true,
      "isProtected": false
    },
    "secret": "9f1c0e7b2a4d6f8c0b3e5a7d9c1f2e4b6a8d0c2e4f6a8b0d2c4e6f8a0b2d4c6e"
  },
  "message": "Client "ledgerly-web" created. Store the secret now — it is shown only once."
}

grantTypes, responseTypes, tokenEndpointAuthMethod and scopes are derived from the profile — you choose the profile, not the grants. secret is absent for public_pkce, and never appears again on any read.

The secret is shown once

Store it in a secret manager immediately. Only an encrypted form is kept, no endpoint can return it again, and the response is sent with Cache-Control: no-store.

Redirect URI rules

  • No whitespace, wildcards or fragments. At most 10 URIs per client.
  • HTTPS is required, except http on localhost, 127.0.0.1 or ::1 for development.
  • Native clients may use a custom scheme; they may not register HTTPS on a loopback host.
  • Service clients register no redirect URI at all.
  • Matching is exact: scheme, host, port and path. https://app.ledgerly.com and https://app.ledgerly.com/ are different URIs.

Resources and scopes

The resources list is the client's allow-list of audiences — at most three. A browser client assigned a resource receives its user-facing scope; a service client receives the :service form. A client can never mint a token for an audience it was not assigned.

Lifecycle

PATCH /apps/:appId/oauth-clients/:clientId
EffectMerge changes: name, redirect URIs, resources, trusted flag, logout scope. The profile is immutable.
POST …/oauth-clients/:clientId/credentials/rotate
EffectIssue a new secret. The previous secret stops working immediately.
POST …/oauth-clients/:clientId/deactivate
EffectRefuse new authorizations and token requests without deleting the row.
POST …/oauth-clients/:clientId/activate
EffectTurn the client back on. Both operations are idempotent.

PATCH merges, POST replaces

An edit through PATCH preserves the stored provider contract — token endpoint auth method, grant types and scope — even when you only send one field. Only POST writes the full canonical contract. Do not rebuild a client to change its name.

Something here out of date or unclear?

The platform team answers integration questions directly.

support@versified.com.gh
32 pages in this documentation