Skip to content

Auth

Chronicle supports two authentication modes:

  • User login — a human operator authenticates with a username and password. The CLI caches the resulting token for subsequent requests.
  • Client credentials — an application identity authenticates using a client ID and client secret. Configure these values on the active context using cratis context set-value client-id and cratis context set-value client-secret.

When no authentication is configured or required, commands connect anonymously.

Shows the current authentication state for the active context: the logged-in user, whether client credentials are configured, or that no authentication is active.

Terminal window
cratis chronicle auth status

Check authentication status:

Terminal window
cratis chronicle auth status

Get machine-readable status:

Terminal window
cratis chronicle auth status -o json

Authenticates as a user using the resource owner password credentials flow. The CLI stores the resulting token in the active context for use by subsequent commands.

Terminal window
cratis chronicle login <USERNAME>

If you omit --secret, the CLI prompts for the password interactively so it does not appear in your shell history.

ArgumentDescription
USERNAMEThe username to authenticate as.
FlagDescription
--secret <PASSWORD>The password. Omit to be prompted interactively.

Log in interactively (password prompt):

Terminal window
cratis chronicle login alice

Log in with password inline (use only in controlled automation):

Terminal window
cratis chronicle login alice --secret mysecret

login is a top-level chronicle command, not a sub-command of auth. The full command is cratis chronicle login, not cratis chronicle auth login.

Clears the cached credentials and token for the active context. Subsequent commands will connect anonymously unless client credentials are configured on the context.

Terminal window
cratis chronicle logout

Log out of the current context:

Terminal window
cratis chronicle logout

logout is a top-level chronicle command, not a sub-command of auth. The full command is cratis chronicle logout, not cratis chronicle auth logout.