Authentication
Console APIs require the HTTP header:
access-token: <JWT>(Defined as Constants.ACCESS_TOKEN in sp-tr-api.)
Non-interactive login (agents + CI)
Email verification flow
Request code (human step or separate automation):
httpGET /api/login/getVerificationCode/{userName}Exchange code for token:
bashsp auth login --email user@corp.com --code 123456 --jsonREST:
POST /api/login/verifywith body{ "userName", "verifyCode", ... }CLI writes token to the shared config file in
${XDG_CONFIG_HOME:-~/.config}/softprobe/config.jsoncunless--no-save.
CI / agent hosts
Set a long-lived token from your secret store:
export SP_TOKEN="eyJ..."
sp app list --jsonNever commit tokens to git. Rotate on leak.
Token refresh
sp auth refresh --user user@corp.com --jsonREST: GET /api/login/refresh/{userName}
Add --no-save when an agent or CI job should receive a token without touching local config:
export SP_TOKEN="$(sp auth refresh --user user@corp.com --no-save --json | jq -r .data.token)"Guest login
If enabled on the server:
sp auth login --guest --jsonREST: POST /api/login/loginAsGuest
OAuth
OAuth flows are browser-based. Agents should use pre-provisioned SP_TOKEN rather than driving OAuth interactively.
Document for humans: GET /api/login/oauthInfo/{oauthType}, POST /api/login/oauthLogin.
Who am I
sp auth whoami --jsonDecodes JWT userName or calls profile endpoint when implemented.
Errors
| Situation | Exit code |
|---|---|
Missing token with --json | 3 (AUTH_REQUIRED) |
| Expired or invalid token | 1 (API_ERROR) |
