docs(api): show the PKCE flow instead of the device flow - #716
Draft
olivermeyer wants to merge 1 commit into
Draft
docs(api): show the PKCE flow instead of the device flow#716olivermeyer wants to merge 1 commit into
olivermeyer wants to merge 1 commit into
Conversation
Rewrite the Authenticate section of the API guide to use the authorization code flow with PKCE. Everything from "Find out what the application expects" onward is unchanged, as is the refresh step. This is a proposal for discussion, not a decided change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. |
|
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.



Why?
We are deciding whether external API users should authenticate with the device flow or with the authorization code flow plus PKCE. The argument is easier to have against concrete text than in the abstract, so this rewrites the guide's Authenticate section the PKCE way to show what users would actually have to do. This is a proposal for discussion, not a decided change — do not merge before we pick a direction.
How?
Replaces steps 1 and 2 of the Authenticate section with the PKCE pair, the
/authorizeURL, and theauthorization_codeexchange, and renumbers the rest. The refresh step, theGET /v1/mecheck, and everything from "Find out what the application expects" onward are untouched, because they do not depend on how the first token was obtained.Three consequences worth weighing before we choose:
opensslfor the random verifier and its SHA-256 challenge. The device flow needed onlycurlandjq.codeout of the address bar, which works for a one-time login but is not unattended. A real integration must run a local listener, so this flow cannot work on a machine with no browser — precisely what the device flow was for.org_idand a real role today. Device-flow clients cannot use Auth0 Organizations, which is the cause of the empty role claim tracked in aignostics/infrastructure#3918.Verified:
sphinx-buildsucceeds, the embeddedhello_aignostics.shpassesbash -n, the PKCE derivation matches the RFC 7636 test vector, and no device-flow references remain indocs/.