Summary
In this repro environment, the macOS broker path ends in NullReferenceException after broker startup fails.
Environment
Microsoft.Identity.Client.Broker 4.83.3
Microsoft.Identity.Client.NativeInterop 0.20.3
- .NET 10.0.105
- macOS 26.3.1, arm64
Repro
Observed through an app using the macOS broker path (WithBroker(new BrokerOptions(OperatingSystems.OSX))) and also confirmed by calling the native runtime directly.
Direct native call result:
MSALRUNTIME_Startup() returns ApiContractViolation (status 6)
- context:
SSO extension is inactive or is not available on this device.
Decompiled RuntimeBroker behavior:
RuntimeBroker catches MsalRuntimeException with ResponseStatus.ApiContractViolation
- stores it in
s_initException
- returns
null from the Lazy<Core> factory
- later uses of
s_lazyCore.Value are not null-checked and end in NullReferenceException
Expected behavior
If broker startup is unavailable, MSAL should surface a descriptive exception or broker-unavailable result. It should not degrade into NullReferenceException.
Notes
This issue is intentionally scoped to the environment above. Related consumer repro: microsoft/powerplatform-build-tools#1352
Summary
In this repro environment, the macOS broker path ends in
NullReferenceExceptionafter broker startup fails.Environment
Microsoft.Identity.Client.Broker4.83.3Microsoft.Identity.Client.NativeInterop0.20.3Repro
Observed through an app using the macOS broker path (
WithBroker(new BrokerOptions(OperatingSystems.OSX))) and also confirmed by calling the native runtime directly.Direct native call result:
MSALRUNTIME_Startup()returnsApiContractViolation(status6)SSO extension is inactive or is not available on this device.Decompiled
RuntimeBrokerbehavior:RuntimeBrokercatchesMsalRuntimeExceptionwithResponseStatus.ApiContractViolations_initExceptionnullfrom theLazy<Core>factorys_lazyCore.Valueare not null-checked and end inNullReferenceExceptionExpected behavior
If broker startup is unavailable, MSAL should surface a descriptive exception or broker-unavailable result. It should not degrade into
NullReferenceException.Notes
This issue is intentionally scoped to the environment above. Related consumer repro: microsoft/powerplatform-build-tools#1352