Authentication
:::caution Products do not share credentials
KOBANA_TOKEN holds one product's credential at a time. A Smart Finance token does not authenticate against any other Kobana product, and vice versa.
:::
The token
Smart Finance authenticates with a JWT signed in RS256 by the Kobana authorization server, sent as Authorization: Bearer <jwt>. See API Authentication for how that token is issued and which scopes it carries — kobana auth login, which belongs to the Banking Gateway, does not produce it.
:::caution The token alone is not enough
The JWT identifies the organization (org claim). Since an organization can own several workspaces, the API also requires the X-Workspace-Id header naming which one to act on — without it the answer is 400 WORKSPACE_REQUIRED. See API Authentication.
:::
Put the JWT in KOBANA_TOKEN before calling the product:
export KOBANA_TOKEN=$JWT_FINANCE
kobana finance financial-accounts list --fields "id,name,balance"
Since the variable is the same for every product, export it per command (or use a per-project .env) if you switch products in the same session:
KOBANA_TOKEN=$JWT_FINANCE kobana finance financial-accounts list --fields "id,name,balance"
Resolution priority
| Priority | Method | Configuration |
|---|---|---|
| 1 | Direct token | KOBANA_TOKEN |
| 2 | Credentials file | KOBANA_CREDENTIALS_FILE |
| 3 | Saved credentials | kobana auth login (Banking Gateway only) |
Environments
The CLI operates in three environments, and each product has its own hosts. Production is the default.
| Environment | API | --env |
|---|---|---|
| Production | api.finance.kobana.com.br | production (default) |
| Sandbox | api.finance.sandbox.kobana.com.br | sandbox |
Smart Finance has no development host of its own: with --env development the CLI falls back to production.
# Production (default — no flag needed)
kobana finance financial-accounts list
# Sandbox
kobana finance financial-accounts list --env sandbox
# Via environment variable
export KOBANA_ENVIRONMENT=sandbox
kobana finance financial-accounts list
Tokens are different across environments — a sandbox token does not work in production and vice versa.
Next steps
- Usage — syntax, resources, examples.
- Environment variables — the full reference, including config and logging.