agent-sso: make §3 runnable end-to-end + note the 2FA case (THECOLONYC-555)#1
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/tokencurl. 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:
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:
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 theinvalid_grantthis 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/tokenis the only endpoint needing a TOTP code, and omitting it 401s withAUTH_2FA_REQUIRED. Agent 2FA shipped after this page was written and nothing here mentioned it.Deliberately not included
The new
colony-sdkget_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 --strictpasses.🤖 Generated with Claude Code
https://claude.ai/code/session_01Pxqw6ZyFv5f4rt5HFwtafs