Prototype room-scoped Mindmap OAuth with PKCE - #594
Draft
nhyiramante1 wants to merge 1 commit into
Draft
Conversation
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.
What
This is a working vertical-slice proof of concept for replacing Mindmap's
launcher grant with a durable room plus Better Auth's OAuth Provider
Authorization Code/PKCE flow.
@better-auth/oauth-provider1.6.22 and the Better Auth JWT plugin.table.
postLogin+consentReferenceIdhooks so the chosen roomfollows consent, authorization code, and access token.
openai:chat/doc:readscopes and asigned
room_idclaim.binding at the protected resource.
non-secret room hint.
PKCE verifier, exchange the code, and load the authorized room.
/api/handoffflow in place for comparison and other tools.The detailed mental model and sequence are in
docs/oauth-rooms-pkce-poc.md.Security shape
PKCE protects the authorization code because the verifier is generated and
retained by Mindmap; it is never passed by the launcher. The room id is an
identifier, not a credential. The backend makes the room selection authoritative
and refuses a valid token against a different room.
This does not claim that browser JavaScript can identify itself
cryptographically, nor that PKCE makes a stolen bearer access token unusable.
Origin checks can remain defense-in-depth for the old flow but are not treated as
client authentication here.
Relationship to #579 and #593
wt_api; Mindmap uses itsdeploy-time backend URL, addressing the attacker-selected proxy concern on Include backend API URL in tool launches #579
for this path.
VITE_BACKEND_URL; its skippedwt_apismoke should become an OAuthlaunch/config smoke after integration.
main(ea6138d6) in a separateclean worktree. It does not include or disturb the dirty/ahead local Mindmap
worktrees.
Deliberate PoC limits
rooms, live sync, or update endpoint yet.
provisioning. Production should pre-provision the known Mindmap client (or
tightly constrain registration) and disable open registration.
Google interactive Playwright run is still needed in a configured deployment.
Validation
authorize request redirects to the configured login page with provider-signed
state
Total: 701 tests passed.