Skip to main content

Validate

Validate a token for authenticity and claims.

osapi controller token validate [flags]

Examples​

osapi controller token validate --token -

Result​

The command prints:

$ osapi controller token validate --token -
Token:
  Key ID:                 2026-11
  Subject:                user123
  Roles:                  read
  Effective permissions:  file:read, health:read, status:read
  Audience:               osapi
  Issued at:              2026-01-15 09:00:00
  Expires at:             2026-04-15 09:00:00

With --json, the command prints:

{
"kid": "2026-11",
"subject": "user123",
"roles": ["read"],
"effective_permissions": ["file:read", "health:read", "status:read"],
"audience": ["osapi"],
"issued_at": "2026-01-15T09:00:00Z",
"expires_at": "2026-04-15T09:00:00Z"
}

Flags​

FlagDescriptionDefault
-t, --tokenThe token (a secret: secret://<vault>/<key>, or - to read it from standard input) (required)

Global flags​

FlagDescriptionDefault
-d, --debugEnable or disable debug mode
-j, --jsonEnable JSON output
-f, --osapi-filePath to config file; without one at the default path, osapi runs on the defaults/etc/osapi/osapi.yaml

Output tells how the result is printed, and what --json gives.