Skip to content

Add --decode flag to get-access-token CLI#66

Merged
Michel Edkrantz (MichelEdkrantz) merged 2 commits intomasterfrom
add-jwt-decode-flag
Mar 24, 2026
Merged

Add --decode flag to get-access-token CLI#66
Michel Edkrantz (MichelEdkrantz) merged 2 commits intomasterfrom
add-jwt-decode-flag

Conversation

@MichelEdkrantz
Copy link
Copy Markdown
Member

@MichelEdkrantz Michel Edkrantz (MichelEdkrantz) commented Mar 24, 2026

Summary

  • Adds a --decode flag to kognic-auth get-access-token that decodes and pretty-prints the full JWT structure (header, payload, and signature) instead of printing the raw token
  • Output includes decoded header (e.g. algorithm), decoded payload (sub, exp, scopes, etc.), and the raw signature
  • Useful for quickly inspecting tokens without external tools

Example output

{
  "header": {
    "alg": "RS256"
  },
  "payload": {
    "sub": "user123",
    "exp": 9999999999
  },
  "signature": "base64url-encoded-signature"
}

Test plan

  • uv run pytest tests/test_cli.py — all tests pass
  • Manual test: kognic-auth get-access-token --decode prints full JWT structure
  • Manual test: kognic-auth get-access-token (without --decode) still prints raw token

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MichelEdkrantz Michel Edkrantz (MichelEdkrantz) merged commit fda5c33 into master Mar 24, 2026
10 checks passed
@MichelEdkrantz Michel Edkrantz (MichelEdkrantz) deleted the add-jwt-decode-flag branch March 24, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants