Skip to main content

Authentication

:::caution Products do not share credentials KOBANA_TOKEN holds one product's credential at a time. A Automatic Billing token does not authenticate against any other Kobana product, and vice versa. :::

The token​

Automatic Billing authenticates with a JWT signed in RS256 by Kobana's 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.

Put the JWT in KOBANA_TOKEN before calling the product:

export KOBANA_TOKEN=$JWT_BILLING
kobana billing subscriptions list --fields "id,status,plan_id"

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_BILLING kobana billing subscriptions list --fields "id,status,plan_id"

Resolution priority​

PriorityMethodConfiguration
1Direct tokenKOBANA_TOKEN
2Credentials fileKOBANA_CREDENTIALS_FILE
3Saved credentialskobana auth login (Banking Gateway only)

Environments​

The CLI operates in three environments, and each product has its own hosts. Production is the default.

EnvironmentAPI--env
Productionapi.billing.kobana.com.brproduction (default)
Sandboxapi.billing.sandbox.kobana.com.brsandbox

Automatic Billing has no development host of its own: with --env development the CLI falls back to production.

# Production (default — no flag needed)
kobana billing subscriptions list

# Sandbox
kobana billing subscriptions list --env sandbox

# Via environment variable
export KOBANA_ENVIRONMENT=sandbox
kobana billing subscriptions list

Tokens are different across environments — a sandbox token does not work in production and vice versa.

Next steps​