Commit 9088d98
Skip browser flow only when WSL has no Windows-browser launcher
On WSL the interactive browser flow only succeeds when:
1. A Windows-side launcher is available (wslu's `wslview` is the
canonical bridge), and
2. WSL2 localhost forwarding can route the OAuth redirect back into
the WSL network namespace (default NAT mode handles this).
When wslview is present the flow works end-to-end and benefits from
Windows session SSO (which is what gets past Conditional Access).
When wslview is absent, xdg-open silently does nothing and
InteractiveBrowserCredential.Authenticate() blocks forever waiting for
a redirect that will never arrive — in that specific case we skip
straight to device code so the user at least sees a code instead of
an indefinite hang.
Env var overrides:
DARC_FORCE_BROWSER_AUTH=1 always attempt browser flow
DARC_USE_DEVICE_CODE=1 always skip browser flow
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent bb914a3 commit 9088d98
1 file changed
Lines changed: 71 additions & 0 deletions
Lines changed: 71 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
61 | 132 | | |
62 | 133 | | |
63 | 134 | | |
| |||
0 commit comments