Skip to content
SHC Docs

shc auth token

print the stored access token for a cluster

Print the access token shc auth login stored for a cluster, alone on stdout, so a script or a curl calls a gated app as the logged-in user. An expired token is refreshed first when the refresh token still works. The tenant is the explicit --tenant realm, default master, as shc auth login takes it; a session stored for another realm is not this tenant’s login. With no cluster argument the active cluster is used.

shc auth token [cluster] [flags]
shc auth token
shc auth token --tenant acme
curl -H "Authorization: Bearer $(shc auth token --tenant acme)" https://cloud.example.com/
-h, --help help for token
-t, --tenant string tenant realm the session was logged in to (default master)
--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)
-v, --verbose verbose output (default: $SHC_VERBOSE)
  • shc auth - authenticate the CLI against a cluster