Skip to content

fix(msal): Deploy platform MSAL assets under SkiaRenderer (backport #24055) - #24131

Merged
kazo0 merged 2 commits into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-24055
Aug 23, 2026
Merged

kazo0 merged 2 commits into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-24055

Conversation

@mergify

@mergify mergify Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #20601

PR Type:

🐞 Bugfix

What changed? 🚀

Under SkiaRenderer, the two-layer runtime asset selection (RuntimeAssetsSelectorTask) replaced Uno.UI.MSAL.dll with the no-op skia flavor on every head, because IsWinRTAssembly only recognized uno, uno.ui.dispatching, and uno.foundation. As a result WithUnoHelpers() silently did nothing: no parent Activity/UIViewController on Android/iOS (MSAL fails with activity_required), and no WasmWebUi/WasmHttpFactory on WebAssembly (no popup flow at all). Full root-cause analysis in this issue comment.

This PR:

  • Adds uno.ui.msal to the WinRT assembly allowlist in RuntimeAssetsSelectorTask. Uno.UI.MSAL only depends on the WinRT layer (Uno.UWP) — verified: the shipped android flavor references only Uno/Mono.Android/MSAL, the webassembly flavor references no Uno assemblies at all — so under the two-layer mode Android/iOS/tvOS/Catalyst heads now deploy (and compile against) the lib/netX.0-<platform> flavor, and WebAssembly deploys the uno-runtime/<tfm>/webassembly flavor.
  • Fails fast with a descriptive error when an expected WinRT-layer asset is missing from a package (previously a late, opaque copy failure), and logs the WinRT-layer redirection for diagnosability.
  • Aligns the Microsoft.Identity.Client dependency floor for the net10 mobile groups in Uno.WinUI.MSAL.nuspec (4.61.3 → 4.72.1, the version the assemblies are compiled against).

No app-side or Uno.WinUI.MSAL package changes are required — the fix acts at app build time. This also transitively revives Uno.Extensions.Authentication.MSAL interactive sign-in on Skia heads (its MsalAuthenticationProvider calls WithUnoHelpers() on both the builder and the interactive request); the remaining desktop issues there (e.g. unoplatform/uno.extensions#3025 macOS token-cache setup) are a separate storage-layer concern.

Validation

  • Task-level: RuntimeAssetsSelectorTask_v0 driven directly against a synthetic uno.winui.msal package layout — skia+android → lib/net10.0-android, skia+ios → lib/net10.0-ios26.0, skia+webassembly → uno-runtime/net10.0/webassembly, single-layer skia (desktop) unchanged, non-allowlisted assemblies keep the pre-fix routing, missing declared flavor throws.
  • End-to-end (real app, Uno.Sdk 6.8.0-dev.10 / uno.winui 6.8.0-dev.21 with the patched task, UnoFeatures=SkiaRenderer, all four heads): SHA-256 of the deployed Uno.UI.MSAL.dll matches the platform flavor on android/ios/wasm and stays on the skia flavor for desktop; app compiles with bare .WithUnoHelpers() (no #if workarounds).
  • Live runtime: interactive sign-in verified on Skia-Android (Chrome custom tab opens with the parent activity supplied) and on Skia-WASM (popup flow via WasmWebUi completes; MSAL.WebUI.js embedded script is extracted and registered in uno-config.js under the Skia renderer). Desktop verified unaffected (system browser + loopback).

Follow-ups intentionally not in this PR: checked-in unit tests for Uno.UI.Tasks (no test project exists today), extending RuntimeAssetsValidatorTask to cover WinRT-layer assemblies, and the browserwasm __UNO__/HAS_UNO_* define gaps (#20875 / #17684) noted in the issue.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable) — validated via task-level scenario harness + end-to-end app validation on all four heads (see Validation above); no Uno.UI.Tasks test project exists to host a checked-in test today
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features)
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated!)

🤖 Generated with Claude Code

https://claude.ai/code/session_01G5xeAHcheZNYf9xE8CzhYJ


This is an automatic backport of pull request #24055 done by [Mergify](https://mergify.com).

@github-actions github-actions Bot added area/code-generation Categorizes an issue or PR as relevant to code generation area/build Categorizes an issue or PR as relevant to build infrastructure labels Aug 19, 2026

@SergioAlmeida29 SergioAlmeida29 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
As it is a backport to #24055 that is already merged.

@kazo0
kazo0 enabled auto-merge August 20, 2026 14:51
@kazo0

kazo0 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@unodevops

Copy link
Copy Markdown
Contributor

kazo0 and others added 2 commits August 22, 2026 08:43
Under SkiaRenderer two-layer asset selection, Uno.UI.MSAL.dll was
replaced by the no-op skia flavor on every head, so WithUnoHelpers()
silently lost WithParentActivityOrWindow on Android/iOS and
WasmWebUi/WasmHttpFactory on WebAssembly.

Uno.UI.MSAL only depends on the WinRT layer (Uno.UWP), so add it to
the WinRT assembly allowlist: Android/iOS heads now deploy and compile
against the lib/netX.0-<platform> flavor, and WebAssembly deploys the
uno-runtime/<tfm>/webassembly flavor. Missing expected assets now fail
the build with a descriptive error instead of a late copy failure, and
the WinRT-layer redirection is logged.

Fixes #20601

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01G5xeAHcheZNYf9xE8CzhYJ
(cherry picked from commit 0cc9dfe)
The net10.0 mobile dependency groups still pinned
Microsoft.Identity.Client 4.61.3 while the assemblies are compiled
against 4.72.1, letting NuGet resolve an older assembly than the one
Uno.UI.MSAL was built against.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01G5xeAHcheZNYf9xE8CzhYJ
(cherry picked from commit 063b5ce)
@kazo0
kazo0 force-pushed the mergify/bp/release/stable/6.7/pr-24055 branch from ec393b3 to d33daf0 Compare August 22, 2026 12:44
@kazo0

kazo0 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 229614 has failed on Uno.UI - CI.

@kazo0
kazo0 merged commit a47ea74 into release/stable/6.7 Aug 23, 2026
65 checks passed
@kazo0
kazo0 deleted the mergify/bp/release/stable/6.7/pr-24055 branch August 23, 2026 14:30
agneszitte added a commit to unoplatform/uno.extensions that referenced this pull request Nov 3, 2026
- global.json: Uno.Sdk 6.8.0-dev.21 -> 6.7.18 (Uno.WinUI 6.7.65), Uno.Sdk.Private 6.8.0-dev.51 -> 6.7.65
- #3163 raised the floor to 6.8.0-dev.46 for the MSAL fix unoplatform/uno#24055. 6.7 has that fix too (unoplatform/uno#24131, in every public 6.7 release from 6.7.65 on), so 6.7 is enough, and 6.7 apps can take 7.4 in the 6.7 SR3 Uno.Sdk
- samples/Directory.Packages.props: Windows SDK build tools 10.0.28000.2526 -> 10.0.28000.2705, what Uno.Sdk 6.7.18 supplies; Uno.Extensions.Hosting.WinUI requires it, and the Playground restore fails with NU1605 below it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
agneszitte added a commit to unoplatform/uno.extensions that referenced this pull request Nov 3, 2026
- UpdatingExtensions.md: the minimum Uno version is now 6.7.65 (Uno.Sdk 6.7.18), with real 6.6 to 6.7 versions in the examples
- HowTo-MsalAuthentication.md: the MSAL fix is in every public 6.7 release from 6.7.65 on (unoplatform/uno#24131), not only in 6.8

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants