Open qvarnstr0m opened 2 months ago
Can you try to delete .WithUseEmbeddedWebView(false)
- that's the default anyway.
I know this is only a couple of weeks old, but have you found any fix or workaround for this issue? I am experiencing the same thing and have not found a fix. Thank you!
Library version used
4.63.0
.NET version
.NET 8.0
Scenario
PublicClient - desktop app
Is this a new or an existing app?
This is a new app or experiment
Issue description and reproduction steps
Bug Description: When attempting to authenticate using
AcquireTokenInteractive
with MSAL on macOS (Darwin 23.4.0, ARM64, M3 chip), aSystem.PlatformNotSupportedException
is thrown. This issue occurs when trying to initiate the authentication flow using the default system web view. The exception trace indicates that the issue arises from theStartDefaultOsBrowserAsync
method withinNetCorePlatformProxy
.Steps to Reproduce:
PublicClientApplicationBuilder
using a redirect URI (e.g.,http://localhost:5666
).AcquireTokenInteractive
.System.PlatformNotSupportedException
is thrown.Expected Behavior: The authentication process should proceed without errors, utilizing either
ASWebAuthenticationSession
or another supported web view method on macOS.Actual Behavior: The authentication flow fails, and the following exception is thrown: System.PlatformNotSupportedException: Operation is not supported on this platform. at Microsoft.Identity.Client.Platforms.netcore.NetCorePlatformProxy.StartDefaultOsBrowserAsync(String url, Boolean isBrokerConfigured) at Microsoft.Identity.Client.SystemWebViewOptions.OpenWithEdgeBrowserAsync(Uri uri) at Microsoft.Identity.Client.Platforms.Shared.Desktop.OsBrowser.DefaultOsBrowserWebUi.InterceptAuthorizationUriAsync(Uri authorizationUri, Uri redirectUri, Boolean isBrokerConfigured, CancellationToken cancellationToken)
Environment:
Additional Information:
msalClient.IsSystemWebViewAvailable
throws aSystem.PlatformNotSupportedException
with the message "Operation is not supported on this platform."WithSystemWebView
andWithUseEmbeddedWebView(true)
yield different exceptions or unsupported behavior on macOS. The issue appears to be related to the platform's handling of web views and default browser interactions.This problem significantly impacts the ability to use MSAL for interactive authentication on macOS ARM64 devices with the M3 chip. Any guidance or a potential fix would be greatly appreciated.
Relevant code snippets
Expected behavior
The authentication process should initiate successfully, and the system's default browser (e.g., Safari on macOS) should open to handle the interactive login flow.
Identity provider
Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
Regression
No response
Solution and workarounds
No response