From 03848e12dfb2f90f9b6b7dddeefbab8e09af36f5 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Mon, 30 Oct 2023 15:42:13 +0100 Subject: [PATCH] Change opening browser on Windows to not use rundll32 --- .../Helpers.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Auth0.OidcClient.MAUI.Platforms.Windows/Helpers.cs b/src/Auth0.OidcClient.MAUI.Platforms.Windows/Helpers.cs index 8e7aa153..9388bb2c 100644 --- a/src/Auth0.OidcClient.MAUI.Platforms.Windows/Helpers.cs +++ b/src/Auth0.OidcClient.MAUI.Platforms.Windows/Helpers.cs @@ -79,11 +79,12 @@ public bool IsUriProtocolDeclared(string scheme) /// The Uri to open public void OpenBrowser(Uri uri) { - var process = new System.Diagnostics.Process(); - process.StartInfo.FileName = "rundll32.exe"; - process.StartInfo.Arguments = $"url.dll,FileProtocolHandler \"{uri.ToString().Replace("\"", "%22")}\""; - process.StartInfo.UseShellExecute = true; - process.Start(); + System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo + { + FileName = uri.ToString(), + UseShellExecute = true + }; + System.Diagnostics.Process.Start(psi); } public static string Encode(string value) @@ -98,4 +99,4 @@ public static string Decode(string value) return Encoding.UTF8.GetString(bytes); } } -} \ No newline at end of file +}