Skip to content

cub auth login

cub auth login

Log into ConfigHub

Synopsis

Authenticate the CLI to ConfigHub, by signing in through the browser, or, for a service account or other identity with a registered key, by signing with its private key, which needs no browser.

By default the credentials are stored in the context matching what you logged into, which may be a different context than the current one (or a new one) if you authenticated as another user or organization. When a context is named explicitly with --context or CUB_CONTEXT, that context is the one updated and it does not become the current context.

Examples:

  # Login (creates or updates current context)
  cub auth login

  # Login to a specific server
  cub auth login --server https://hub.confighub.com

  # Login to a specific existing context
  cub --context prod2 auth login

  # Create a new context and login with a specific server
  cub auth login --new-context --server https://hub.confighub.com

  # Login by signing with a key stored under ~/.confighub/keys, such as a service account's
  cub auth login --private-key=ci-runner

  # Login by signing with a private key held in $CONFIGHUB_AUTH_PRIVATE_KEY
  # (naming a key as well as setting the variable is an error, not a preference)
  cub auth login --private-key

  # Login by signing with a key at an explicit path
  cub auth login --private-key=./deploy.jwk

  # Login as a worker (workers are deprecated) using environment variables
  cub auth login --as-worker

  # Login without automatically opening browser
  cub auth login --no-browser
cub auth login [flags]

Options

      --as-worker                  Authenticate as a worker using CONFIGHUB_WORKER_ID and CONFIGHUB_WORKER_SECRET environment variables
  -h, --help                       help for login
      --new-context                Create a new context during login
      --no-browser                 Do not automatically open browser for authentication
      --organization string        Organization partial name or ID to authenticate to (e.g., Acme, or the organization's UUID)
      --private-key string[="-"]   Authenticate by signing with a private key: an alias under ~/.confighub/keys, a path, or empty to use CONFIGHUB_AUTH_PRIVATE_KEY
      --server string              Server URL to authenticate to (e.g., https://hub.confighub.com)

Options inherited from parent commands

      --context string   The context to use for this command
      --debug            Debug output

SEE ALSO