Skip to content

[v2.15] Open the OAuth authorize URL on Windows without a shell - #663

Merged
pmatseykanets merged 1 commit into
rancher:v2.15from
pmatseykanets:fix-windows-oauth-browser-url-truncation-v2.15
Sep 2, 2026
Merged

pmatseykanets merged 1 commit into
rancher:v2.15from
pmatseykanets:fix-windows-oauth-browser-url-truncation-v2.15

Conversation

@pmatseykanets

@pmatseykanets pmatseykanets commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator

Issue: rancher/rancher#56969

Backport of #657

On Windows, openBrowser launched the browser via `cmd /c start "" <url>`.
cmd.exe parses `&` as a command separator, so authorize URLs with multiple
query parameters (e.g. Azure AD's client_id, scope, response_type) were
truncated before reaching the browser, causing AADSTS900144 failures.

openBrowser now delegates OS-specific launching to a new osOpenURL function.
The Windows implementation uses the ShellExecute API, passing the URL as an
opaque argument with no command line built, so it can't be reinterpreted by
a shell. macOS and Linux keep using exec.Command with the URL as a single
argv element, unchanged in behavior. golang.org/x/sys moves from an indirect
to a direct dependency, matching the new osOpenURL import.
@pmatseykanets
pmatseykanets merged commit d56f714 into rancher:v2.15 Sep 2, 2026
1 check passed
@pmatseykanets
pmatseykanets deleted the fix-windows-oauth-browser-url-truncation-v2.15 branch September 2, 2026 15:06
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.

2 participants

⌂ 换网址