prerequisites
Prerequisites
The Admin SDK examples authenticate as a management application via the OAuth 2.0 client_credentials grant and drive the Admin API (/api/v3/admin/**). Before running any example you must:
-
Provide connection settings. The SDK reads its endpoint from the
adminsdk.*keys in acli.propertiesfile (loaded from the working directory, from the file named by thecli.configsystem property, or from the classpath):adminsdk.scheme—https(orhttpfor a plain local endpoint).adminsdk.host— the Admin API host (edge or direct).adminsdk.port— the Admin API port.
-
Provide the management client credentials. The client id and the (optional) bound tenant come from the environment or the same
cli.properties; the secret is read into a zeroizable buffer and closed immediately after authentication:ADMIN_CLIENT_IDenv var (or theadminsdk.clientIdproperty).ADMIN_CLIENT_SECRETenv var (or theadmin.client.secretsystem property, or the interactive console prompt).ADMIN_TENANT_IDenv var (or theadminsdk.tenantIdproperty) — the tenant the SDK is scoped to. It is optional: with no tenant the SDK holds a platform-scope session and the tenant-scoped scenarios skip gracefully.
-
Point at a STANDARD tenant for the read scenarios. The tenant-scoped read examples (inventory of keys, actors, users, policies, audit) need a
STANDARD(notSIMPLE) tenant that hosts those resources. A call that is not permitted or not applicable is reported and skipped on its transport status (403/422) — the examples never infer intent from a failure.
The mutating scenarios (Admin Scenarios 9–14 — runtime identity provisioning, key create, exchange grants, internal crypto use cases, tenant policies, organisation model) create and then clean up resources, so run them against a disposable sandbox tenant, never production data. Every created resource is registered for best-effort, idempotent cleanup.
Tenant-lifecycle scenario (Admin Scenario 15) — platform-scoped
Admin Scenario 15 creates, activates, and suspends a throwaway tenant (there is no tenant-delete on the control plane). It requires a platform-scoped session (a management client with the platform tenant-lifecycle scope) rather than a single bound tenant. Run it only where creating and suspending tenants is safe; without platform scope it skips gracefully on 403.