[Bug] System browser process on Linux writes junk to standard out/error
See original GitHub issueSee the original issue: https://github.com/microsoft/Git-Credential-Manager-Core/issues/286
Logs and Network traces
Which Version of MSAL are you using ? 4.3.0
Platform netcoreapp3.1
What authentication flow has the issue?
- Desktop / Mobile
- Interactive - system browser
Is this a new or existing app? b. The app is in production, I haven’t upgraded MSAL, but started seeing this issue
Repro On Linux, create a new console app, set Chromium set as your default browser and open an existing tab:
var pca = BuildPublicClientApplication();
var result = await pca.AcquireTokenInteractive().ExecuteAsync();
Expected behavior A new tab is opened to the authentication page; nothing is written to the console.
Actual behavior Text is written to the console.
Possible Solution Detach/redirect stdout & err from the child process when launching a browser on Linux.
Additional context/ Logs / Screenshots
The problem appears to be the use of Process.Start
when opening the URL on Linux. The .NET Core BCL uses xdg-open
(amongst others) to start the new process/default browser, but it does not detach the standard in/out/err streams from the calling process. This means anything written by the browser (e.g., Chromium) or xdg-open
will be written to the entry process’ streams!
In GCM, who is invoked by Git, we must communicate back to Git over the standard output stream, and this noise is causing issues.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
This is included in MSAL 4.30.0 release.
cc: @mjcheetham
Hi @pmaytak I’ve just tried the new package out, and this still does not fix the issue (see my reply on the PR).
If you’re looking for a repro, here’s the smallest one:
☝️ those messages to standard out/error should not be written.