fix(auth): rewrite stale MiniMax OAuth verification_uri host - #19550
Closed
Tranquil-Flow wants to merge 1 commit into
Closed
fix(auth): rewrite stale MiniMax OAuth verification_uri host#19550Tranquil-Flow wants to merge 1 commit into
Tranquil-Flow wants to merge 1 commit into
Conversation
MiniMax's OAuth /oauth/code endpoint returns verification_uri pointing at https://www.minimax.io/oauth-authorize?..., but that path was retired and 307-redirects to the marketing homepage, leaving users with no way to approve the device code. The live approval UI is on https://platform.minimax.io. Add a defensive client-side rewrite in _minimax_oauth_login that normalises only the exact stale host+path pair before printing or opening the URL. Other hosts pass through unchanged so the rewrite auto-disables once MiniMax fixes the server response, and the CN portal (api.minimaxi.com) is unaffected. Fixes NousResearch#19337
Collaborator
1 similar comment
Collaborator
Contributor
Author
|
Closing in favor of #19466 — that PR covers the same |
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 does this PR do?
MiniMax's OAuth
/oauth/codeendpoint returns averification_uriof the formhttps://www.minimax.io/oauth-authorize?user_code=...&client=OpenClaw, but that path was retired and now 307-redirects to the marketing homepage/, leaving users with no way to approve the device code. The live approval UI is athttps://platform.minimax.io/oauth-authorize?....This PR adds a defensive client-side rewrite in
_minimax_oauth_login: whenverification_urihost is exactlywww.minimax.ioand the path starts with/oauth-authorize, the host is rewritten toplatform.minimax.iobefore the URL is printed or opened. Any other host or path passes through unchanged, so the rewrite auto-disables once MiniMax fixes the server response, and the CN portal (api.minimaxi.com) is unaffected (different brand domain entirely).This is option (1) from the issue. The reporter flagged option (2) — escalating to MiniMax to fix the server-side
verification_uri— as the cleaner long-term path, but unblocking users today is worth the small workaround.Related Issue
Fixes #19337
Type of Change
Changes Made
hermes_cli/auth.py— add_minimax_normalize_verification_uri(url)helper just above_minimax_pkce_pair; apply it at the call site in_minimax_oauth_loginwhereverification_uriis read fromcode_data. A short comment block in the source records the workaround and its removal condition.parts.hostnameandparts.portare accessed inside thetrybecause both properties re-parse the netloc and can raiseValueErroron malformed input (e.g. an out-of-range port).tests/test_minimax_oauth.py— add three unit tests covering: (a) the real-world stale URL gets rewritten with the query string preserved, (b) unrelated URLs (already-platform host, apexminimax.io, CNminimaxi.com, non-authorize paths) pass through unchanged, (c) malformed/empty/bad-port inputs are returned untouched.How to Test
Checklist
Code
Documentation & Housekeeping