Skip to content

One-time tokens

A one-time token is the simplest and most general way to get a certificate from BastionXP CA. An administrator creates it; whoever holds it may request one certificate of one kind for the names in it, until it expires.

The administrator creates a token and hands it to the requester, which makes a key pair and posts the token and CSR to BastionXP CA server, which checks the token and returns the certificate The administrator creates a token and hands it to the requester, which makes a key pair and posts the token and CSR to BastionXP CA server, which checks the token and returns the certificate

Properties

Property Value
Uses One certificate. Enforced by the database, across restarts.
Lifetime 10 minutes by default; --valid-for up to 24 hours.
Profile Fixed in the token: a tls-server token cannot get an SSH certificate.
Names Fixed in the token; the requester may ask for fewer, never more.
Subject Who it is for (--subject); written to the CA's log and to the SSH key ID. Gives no permission.
Key binding Tokens made by the server after a login can be tied to one public key.
Format A JWT signed by the CA's token.key (ECDSA P-256, ES256).

Works with

Request Command
TLS certificate bxp tls --token <t> --name ...
SSH user / host certificate bxp ssh --token <t> --key ...
SCEP enrollment the token as the SCEP challenge password
Your own tooling Authorization: Bearer <t> on the HTTP API

When to use tokens

  • Servers and services that are set up by hand or by configuration management (Ansible, Terraform, cloud-init).
  • CI jobs and scripts.
  • One-off certificates.
  • Machines that cannot open a browser and have no directory password.

For people who need certificates every day, OIDC or LDAP logins are more comfortable; for servers that can prove control of their name, ACME needs no human at all.

Security

  • A token is a bearer secret until it is used: hand it over privately, and keep its lifetime short.
  • A request refused for its names, its CSR or its key does not use up the token, so it can be corrected and sent again.
  • Of two requests with the same token, only one can win, even at the same moment.
  • Tokens made on the CA machine are not logged when made; each certificate issued line names the token it used (token_id). Tokens made by the server after a login are logged as token created, with who made them.