Skip to content
SHC Docs

shc auth create-service-client

mint a confidential service-account client for automation (terraform/CI)

Fetch-or-create a confidential OIDC client in the master realm with the client_credentials grant enabled (all interactive flows disabled), the credential terraform providers and CI pipelines authenticate with via shc auth login --client-credentials or a direct token grant. Because it lives in the master realm, every token it mints is SHC platform root (platform:manage is implicit for master-realm identities), so guard the secret accordingly.

A scope narrows that. With platform:read the client holds only the read-only platform role: it reads the condition snapshot, its catalogue and the deployment list across every tenant, and every other route refuses it. An existing client holding other rights is refused rather than narrowed.

--seal writes the credential, the client id and the secret joined by a colon, into that vault key at the estate-wide tier and prints no secret at all.

The client secret is printed once, on create; it is not retrievable later. --fields client_secret -o text prints the secret alone, for shc auth login --client-secret - to read from standard input. Re-running against an existing client is an idempotent no-op that reports the client id only. Pass --rotate-secret to regenerate (and print) a new secret, which immediately invalidates the old one.

The access-token lifespan is stamped per-client at create time (--token-lifespan, default 3600s): the realm default (60s) is unusable for automation runs. Requires platform:manage (local socket, or a logged-in platform admin).

shc auth create-service-client <name> [scope] [flags]
shc auth create-service-client terraform
shc auth create-service-client ci --token-lifespan 7200
shc auth create-service-client terraform --rotate-secret
shc auth create-service-client drover platform:read --seal drover_shc_read
-h, --help help for create-service-client
--rotate-secret regenerate the secret of an existing client (invalidates the old secret) and print the new one
--seal string seal the client id and the secret, joined by a colon, into this vault key at the estate-wide tier instead of printing the secret
--token-lifespan int per-client access-token lifespan in seconds, stamped at create time (default 3600)
--config stringArray extra YAML config file to layer on top of auto-discovered config; repeatable, later files win
-d, --debug enable debug mode (default: $SHC_DEBUG)
-e, --environment string environment name (default: "prod", or "default" on an estate with no licence and no trial; $SHC_ENVIRONMENT and shc ctx -e override it, and the "master" tenant is always "default")
--exclude string comma-separated dotted paths to drop
--fields string comma-separated columns/keys to show (and their order)
--filter string comma-separated dotted paths to keep (drops everything else)
-o, --output string output format: tty|text|json|yaml (default: $SHC_OUTPUT)
-s, --stack string stack name (default: $SHC_STACK)
-t, --tenant string tenant name (default: $SHC_TENANT)
-v, --verbose verbose output (default: $SHC_VERBOSE)
  • shc auth - authenticate the CLI against a cluster