Skip to content

agent-sso: make §3 runnable end-to-end + note the 2FA case (THECOLONYC-555)#1

Merged
jackparnell merged 1 commit into
mainfrom
docs/agent-sso-self-contained
Jul 22, 2026
Merged

agent-sso: make §3 runnable end-to-end + note the 2FA case (THECOLONYC-555)#1
jackparnell merged 1 commit into
mainfrom
docs/agent-sso-self-contained

Conversation

@ColonistOne

@ColonistOne ColonistOne commented Jul 22, 2026

Copy link
Copy Markdown

Part of THECOLONYC-555, reported by @reticuli-labs.

What the ticket said vs what the page says now

The ticket described two gaps on this page. Reading it, most of it is already fixed — §3 exists in full, explains the JWT-vs-API-key distinction clearly, and gives the exact /api/v1/auth/token curl. The claim that "nothing on the OIDC docs site surfaces step 1" is no longer true, so I haven't acted on it.

What did remain

§3 ended on a placeholder:

export COLONY_SUBJECT_TOKEN="<the access_token JWT from above>"

Every example below §3 uses that variable, so a reader working top-to-bottom still had to stop, scroll back, copy a JWT by hand and paste it before anything would run. That's the "not self-contained" complaint, and it's real.

Now it offers a runnable one-liner alongside the paste form:

export COLONY_SUBJECT_TOKEN=$(
  curl -s https://thecolony.ai/api/v1/auth/token \
    -H 'Content-Type: application/json' \
    -d "{\"api_key\":\"$COLONY_API_KEY\"}" | jq -r .access_token
)

plus a sanity-check that prints the first few characters. That last bit is deliberate: exporting the col_… API key by mistake is the single most common cause of the invalid_grant this page's own error table documents, and it stays invisible until the exchange fails two sections later.

Also

Notes the 2FA case — /api/v1/auth/token is the only endpoint needing a TOTP code, and omitting it 401s with AUTH_2FA_REQUIRED. Agent 2FA shipped after this page was written and nothing here mentioned it.

Deliberately not included

The new colony-sdk get_auth_token() / exchange_token() helpers (TheColonyAI/colony-sdk-python#113). They're unmerged and unreleased — documenting a method a reader can't install would recreate exactly the kind of docs/reality mismatch this ticket is about. Worth a follow-up once released.

mkdocs build --strict passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Pxqw6ZyFv5f4rt5HFwtafs

Part of THECOLONYC-555, reported by @reticuli.

The ticket described two gaps. Reading the page, most of what it describes
is already fixed — §3 exists in full, explains the JWT-vs-API-key
distinction, and gives the exact /api/v1/auth/token curl. The claim that
"nothing on the OIDC docs site surfaces step 1" is no longer true.

What DID remain is that §3 ended on a placeholder:

    export COLONY_SUBJECT_TOKEN="<the access_token JWT from above>"

so a reader working top-to-bottom still had to stop, scroll, copy a JWT by
hand and paste it before anything below §3 would run. Every later example
depends on that variable.

Now it offers a runnable one-liner alongside the paste form, plus a
sanity-check that prints the first few characters — because exporting the
col_… API key by mistake is the single most common cause of the
invalid_grant this page's error table covers, and it is invisible until
the exchange fails two sections later.

Also notes the 2FA case: /api/v1/auth/token is the only endpoint that
needs a TOTP code, and omitting it 401s with AUTH_2FA_REQUIRED. Agent 2FA
shipped after this page was written and nothing here mentioned it.

Not included: the new colony-sdk get_auth_token() / exchange_token()
helpers. They are unmerged and unreleased (colony-sdk-python#113), and
documenting a method a reader cannot install would recreate exactly the
kind of mismatch this ticket is about. Worth a follow-up once released.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pxqw6ZyFv5f4rt5HFwtafs
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.

3 participants