-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] System browser process on Linux writes junk to standard out/error #2427
Comments
Hi @mjcheetham I don't know if I was able to repro the exact behavior. I tried on Ubuntu with Chromium. I built my test project for Linux, then ran that executable from the terminal window.
Is the expectation that a new terminal window should be open for that console output? Or is this a different behavior that you're getting? |
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: namespace TestApp
{
class Program
{
public static async Task Main(string[] args)
{
const string clientId = "872cd9fa-d31f-45e0-9eab-6e460a02d1f1";
string[] scopes = new { "User.Read" };
var pca = PublicClientApplicationBuilder.Create(clientId)
.WithRedirectUri("http://localhost")
.Build();
var result = await pca.AcquireTokenInteractive(scopes).ExecuteAsync();
}
}
} <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Identity.Client" Version="4.28.1" />
</ItemGroup>
</Project> $ dotnet run
(chrome:21189): Gtk-WARNING **: 13:58:53.285: Theme parsing error gtk.css:1565.23: 'font-feature-settings' is not a valid property name
(chrome:21189): Gtk-WARNING **: 13:58:53.289: Theme parsing error gtk.css:3615.25: 'font-feature-settings' is not a valid property name
(chrome:21189): Gtk-WARNING **: 13:58:53.290: Theme parsing error gtk.css:4077.23: 'font-feature-settings' is not a valid property name
Opening in existing browser session. ☝️ those messages to standard out/error should not be written. |
This is included in MSAL 4.30.0 release. cc: @mjcheetham |
See the original issue: git-ecosystem/git-credential-manager#286
Logs and Network traces
Which Version of MSAL are you using ?
4.3.0
Platform
netcoreapp3.1
What authentication flow has the issue?
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:
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 usesxdg-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) orxdg-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.
The text was updated successfully, but these errors were encountered: