You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Auth] MSAL Platform specific code does not work in SkiaRenderer mode #20601
changed the title [-][MSAL] Platform specific code does not work in SkiaRenderer mode[/-][+][Auth][MSAL] Platform specific code does not work in SkiaRenderer mode[/+]on Nov 25, 2025
changed the title [-][Auth][MSAL] Platform specific code does not work in SkiaRenderer mode[/-][+][Auth] Platform specific code does not work in SkiaRenderer mode[/+]on Jan 13, 2026
This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.
Did a full root-cause pass on this. Summary up front: the #if blocks in the add-in are not the problem — they compile correctly. The platform-specific Uno.UI.MSAL.dll is built and shipped in the package, but never deployed. Under SkiaRenderer, the runtime-asset swap replaces it with the no-op skia flavor on every head, including WebAssembly.
ReplaceUnoRuntime (uno.winui.runtime-replace.targets) passes both to RuntimeAssetsSelectorTask, which decides per-assembly whether to take the native lib/ asset or the uno-runtime/<tfm>/skia one. That decision is IsWinRTAssembly, and decompiled it is a hardcoded allowlist of three names:
privateboolIsWinRTAssembly(stringfileNameWithoutExtension){vars=fileNameWithoutExtension.ToLower(CultureInfo.InvariantCulture);returnsis"uno" or "uno.ui.dispatching" or "uno.foundation";}
Only those three take the GetWinRTAssembly path back out to lib/net10.0-<winrt-rid>*. Everything else — including Uno.UI.MSAL — gets the skia flavor.
There is no opt-in for add-in packages.UnoRuntimeEnabledPackage only carries PackageBasePath:
which means this cannot be fixed by repackaging Uno.WinUI.MSAL alone. Any add-in shipping platform-flavored lib/ assets alongside a uno-runtime folder has the same problem.
WebAssembly is affected too, not just Android/iOS
browserwasm also deploys the skia no-op rather than uno-runtime/net10.0/webassembly (3f6b1990…), which is where WasmWebUi, WithCustomWebUi and WithHttpClientFactory live. Confirmed in the shipped webcil — the only relevant symbol present is WithUnoHelpers:
The browserwasm row looks wrong independently of this issue — no __UNO__ and no HAS_UNO_SKIA under SkiaRenderer. Consistent with #20875 and #17684. Worth confirming separately.
It also means the documented app-level workaround needs platform-correct guards: #if ANDROID / #elif IOS work, but #if __ANDROID__ / #elif __APPLE_UIKIT__ (matching the add-in's own source) silently compile to nothing in a consumer app.
Proposed fix
The MAUI Embedding fix for the same root cause (#20439 → unoplatform/uno.extensions#2788) sidestepped the allowlist entirely, and is a good template:
Move the platform implementations behind an interface in the neutral assembly
Ship a satellite package — Uno.Extensions.Maui.WinUI.Runtime.Skia, multi-targeting net9.0-android;net9.0-ios;net9.0-maccatalyst with UnoFeatures=SkiaRenderer — supplying the implementation
Resolve it at runtime
Applied here that's a Uno.WinUI.MSAL.Runtime.Skia-style package, whose assemblies are picked by ordinary TFM resolution and never touch RuntimeAssetsSelectorTask. Naming precedent already exists with Uno.WinUI.Runtime.Skia.Android / .AppleUIKit.
The alternative — giving IsWinRTAssembly an extensibility point, e.g. <UnoRuntimeEnabledPackage ... WinRTFlavoredAssemblies="Uno.UI.MSAL" /> — is a smaller change and would fix every add-in in this position at once, but is a Uno.UI.Tasks change rather than an add-in one.
Either way WASM needs handling explicitly: there is currently no flavor of Uno.UI.MSAL that provides ICustomWebUi to a Skia-rendered browser head.
App-level workaround (current packages)
Replacing .WithUnoHelpers() on the builder works today, because app code still compiles against the native TFM:
Uno.dll is on the IsWinRTAssembly allowlist, so ContextHelper resolves to the real Android implementation. No equivalent workaround exists for WASM without hand-writing an ICustomWebUi.
changed the title [-][Auth] Platform specific code does not work in SkiaRenderer mode[/-][+][Auth] MSAL Platform specific code does not work in SkiaRenderer mode[/+]on Aug 12, 2026
Activity
[-][MSAL] Platform specific code does not work in SkiaRenderer mode[/-][+][Auth][MSAL] Platform specific code does not work in SkiaRenderer mode[/+][-][Auth][MSAL] Platform specific code does not work in SkiaRenderer mode[/-][+][Auth] Platform specific code does not work in SkiaRenderer mode[/+]github-actions commentedon May 14, 2026
This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.
kazo0 commentedon Aug 12, 2026
Did a full root-cause pass on this. Summary up front: the
#ifblocks in the add-in are not the problem — they compile correctly. The platform-specificUno.UI.MSAL.dllis built and shipped in the package, but never deployed. UnderSkiaRenderer, the runtime-asset swap replaces it with the no-opskiaflavor on every head, including WebAssembly.Environment
Uno.Sdk6.8.0-dev.10Uno.WinUI/Uno.WinUI.MSAL6.8.0-dev.21Microsoft.Identity.Client4.87.010.0.103(macOS)net10.0-android;net10.0-ios;net10.0-browserwasm;net10.0-desktopUnoFeaturesSkiaRendererEvidence: every head gets the same assembly
SHA-256 of the
Uno.UI.MSAL.dllvariants in the package, against what actually lands in the app output:All four resolve to the
skiano-op. DisassemblingAbstractApplicationBuilderExtensions.WithUnoHelpers:lib/net10.0-androidWithParentActivityOrWindow(() => ContextHelper.Current)lib/net10.0-ios26.0WithParentActivityOrWindow(() => UIApplication.SharedApplication.KeyWindow.RootViewController)uno-runtime/…/skia(deployed)ldarg.0; retSo MSAL is left with no parent activity / view controller, and
AcquireTokenInteractivehas nothing to attach to.Root cause
Under
SkiaRenderer, mobile heads carry a two-axis identifier (verified via-getProperty):ReplaceUnoRuntime(uno.winui.runtime-replace.targets) passes both toRuntimeAssetsSelectorTask, which decides per-assembly whether to take the nativelib/asset or theuno-runtime/<tfm>/skiaone. That decision isIsWinRTAssembly, and decompiled it is a hardcoded allowlist of three names:Only those three take the
GetWinRTAssemblypath back out tolib/net10.0-<winrt-rid>*. Everything else — includingUno.UI.MSAL— gets the skia flavor.There is no opt-in for add-in packages.
UnoRuntimeEnabledPackageonly carriesPackageBasePath:which means this cannot be fixed by repackaging
Uno.WinUI.MSALalone. Any add-in shipping platform-flavoredlib/assets alongside auno-runtimefolder has the same problem.WebAssembly is affected too, not just Android/iOS
browserwasmalso deploys theskiano-op rather thanuno-runtime/net10.0/webassembly(3f6b1990…), which is whereWasmWebUi,WithCustomWebUiandWithHttpClientFactorylive. Confirmed in the shipped webcil — the only relevant symbol present isWithUnoHelpers:So under
SkiaRendererthe WASM popup flow is gone as well. That flavor is only selected by the legacy renderer.Secondary finding: WASM gets no Uno constants at all
Actual symbols reaching the compiler (
-t:GenerateAssemblyInfo -getProperty:DefineConstants):net10.0-androidANDROID,__UNO__,__UNO_SKIA__,__UNO_SKIA_ANDROID__,HAS_UNO_SKIA__ANDROID__net10.0-iosIOS,__IOS__,__UNO__,__UNO_SKIA__,__UNO_SKIA_APPLE_UIKIT____APPLE_UIKIT__net10.0-browserwasmBROWSERWASM,NETonly__WASM__,__UNO__, and everyHAS_UNO_*The
browserwasmrow looks wrong independently of this issue — no__UNO__and noHAS_UNO_SKIAunderSkiaRenderer. Consistent with #20875 and #17684. Worth confirming separately.It also means the documented app-level workaround needs platform-correct guards:
#if ANDROID/#elif IOSwork, but#if __ANDROID__/#elif __APPLE_UIKIT__(matching the add-in's own source) silently compile to nothing in a consumer app.Proposed fix
The MAUI Embedding fix for the same root cause (#20439 → unoplatform/uno.extensions#2788) sidestepped the allowlist entirely, and is a good template:
Uno.Extensions.Maui.WinUI.Runtime.Skia, multi-targetingnet9.0-android;net9.0-ios;net9.0-maccatalystwithUnoFeatures=SkiaRenderer— supplying the implementationApplied here that's a
Uno.WinUI.MSAL.Runtime.Skia-style package, whose assemblies are picked by ordinary TFM resolution and never touchRuntimeAssetsSelectorTask. Naming precedent already exists withUno.WinUI.Runtime.Skia.Android/.AppleUIKit.The alternative — giving
IsWinRTAssemblyan extensibility point, e.g.<UnoRuntimeEnabledPackage ... WinRTFlavoredAssemblies="Uno.UI.MSAL" />— is a smaller change and would fix every add-in in this position at once, but is aUno.UI.Taskschange rather than an add-in one.Either way WASM needs handling explicitly: there is currently no flavor of
Uno.UI.MSALthat providesICustomWebUito a Skia-rendered browser head.App-level workaround (current packages)
Replacing
.WithUnoHelpers()on the builder works today, because app code still compiles against the native TFM:Uno.dllis on theIsWinRTAssemblyallowlist, soContextHelperresolves to the real Android implementation. No equivalent workaround exists for WASM without hand-writing anICustomWebUi.[-][Auth] Platform specific code does not work in SkiaRenderer mode[/-][+][Auth] MSAL Platform specific code does not work in SkiaRenderer mode[/+]feat(samples): Add MSAL authentication sample
fix(msal): Deploy platform MSAL assets under SkiaRenderer
fix(msal): Deploy platform MSAL assets under SkiaRenderer
khaskoul commentedon Aug 24, 2026
Fix verified in 6.7.16