diff --git a/src/D2L.Bmx/BrowserLauncher.cs b/src/D2L.Bmx/BrowserLauncher.cs index 9a945af7..cbf65e2a 100644 --- a/src/D2L.Bmx/BrowserLauncher.cs +++ b/src/D2L.Bmx/BrowserLauncher.cs @@ -26,10 +26,6 @@ internal class BrowserLauncher : IBrowserLauncher { "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge", ]; - private static readonly string[] LinuxPaths = [ - "/opt/google/chrome/chrome", - "/opt/microsoft/msedge/msedge", - ]; async Task IBrowserLauncher.LaunchAsync( string browserPath ) { var launchOptions = new LaunchOptions { @@ -59,10 +55,9 @@ bool IBrowserLauncher.TryGetPathToBrowser( [NotNullWhen( returnValue: true )] ou } else if( OperatingSystem.IsMacOS() ) { path = Array.Find( MacPaths, File.Exists ); return path is not null; - } else if( OperatingSystem.IsLinux() ) { - path = Array.Find( LinuxPaths, File.Exists ); - return path is not null; } + // Okta DSSO is only supported for Windows and Mac. There's no point for us to support Linux. + // Chromium is finicky on Linux anyway. return false; } } diff --git a/src/D2L.Bmx/OktaAuthenticator.cs b/src/D2L.Bmx/OktaAuthenticator.cs index b58bf51b..12c5c8dd 100644 --- a/src/D2L.Bmx/OktaAuthenticator.cs +++ b/src/D2L.Bmx/OktaAuthenticator.cs @@ -59,7 +59,12 @@ bool ignoreCache return new( Org: org, User: user, Client: oktaAuthenticated ); } - if( browserLauncher.TryGetPathToBrowser( out string? browserPath ) ) { + if( + // `TryGetPathToBrowser` does return `false` for Linux, but excluding Linux earlier here helps + // the compiler trim more unused code (e.g. all of PuppeteerSharp) + !OperatingSystem.IsLinux() + && browserLauncher.TryGetPathToBrowser( out string? browserPath ) + ) { if( !nonInteractive ) { Console.Error.WriteLine( "Attempting Okta passwordless authentication..." ); }