Skip to content

fix(sdk): Mark MSAL as supported on the desktop target - #24084

Merged
MartinZikmund merged 1 commit into
masterfrom
dev/sb/msal-desktop-supported
Aug 15, 2026
Merged

fix(sdk): Mark MSAL as supported on the desktop target#24084
MartinZikmund merged 1 commit into
masterfrom
dev/sb/msal-desktop-supported

Conversation

@kazo0

@kazo0 kazo0 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

GitHub Issue: none — found while building the MSAL + Uno.Extensions sample for Uno.Samples; happy to file one if preferred.

PR Type:

🐞 Bugfix

What changed? 🚀

IsMSALSupported gates the AuthenticationMsal UnoFeature's implicit references to Microsoft.Identity.Client, Microsoft.Identity.Client.Extensions.Msal and Uno.WinUI.MSAL. It is set by the android, ios, wasm and winappsdk common targets — but not desktop, and it is the only consumer of the property (no error targets or linker configs key off it).

The gate doesn't actually keep MSAL off desktop: Uno.Extensions.Authentication.MSAL.WinUI is injected unconditionally, and its desktop TFM drags all three packages in transitively at their nuspec floors. The observable effect is silent version drift, e.g. on Uno.Sdk 6.8.0-dev.12:

TFM Uno.WinUI.MSAL resolved
net10.0-android / -ios / -browserwasm 6.8.0-dev.22 (implicit, SDK-pinned)
net10.0-desktop 6.0.465 (transitive floor)

MSAL has always worked on desktop — the loopback flow is pure MSAL.NET, and the skia flavour's no-op WithUnoHelpers() is the correct behaviour there. Microsoft.Identity.Client.Extensions.Msal is specifically the desktop token-cache helper (DPAPI / keychain / keyring), so desktop is the head that needs these pins most (mobile persists natively).

This sets IsMSALSupported=true in Uno.Common.Desktop.targets, mirroring the other heads, so AuthenticationMsal resolves the same SDK-pinned versions everywhere. MacCatalyst is intentionally not touched (dropped from the Uno.Sdk in f91aa26).

Validation: desktop-only AuthenticationMsal app on Uno.Sdk 6.8.0-dev.12 — dotnet restore as shipped resolves Uno.WinUI.MSAL/6.0.465; dotnet restore -p:IsMSALSupported=true (equivalent to this change) resolves Uno.WinUI.MSAL/6.8.0-dev.22 and Microsoft.Identity.Client(.Extensions.Msal)/4.87.0.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample — validated via restore-graph comparison described above
  • 📚 Docs have been added/updated — no doc states MSAL is unsupported on desktop; nothing to update
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests

🤖 Generated with Claude Code

https://claude.ai/code/session_019BJKK7KeJ14DVxxW5UmJqo

The AuthenticationMsal UnoFeature gates Microsoft.Identity.Client,
Microsoft.Identity.Client.Extensions.Msal and Uno.WinUI.MSAL behind
IsMSALSupported, which android, ios, wasm and winappsdk set - but not
desktop. Uno.Extensions.Authentication.MSAL.WinUI is injected
unconditionally, so on netX.0-desktop the three packages still come in,
just transitively at their nuspec floors (e.g. Uno.WinUI.MSAL 6.0.465
alongside a current Uno.WinUI) instead of the Uno.Sdk-pinned versions.

MSAL has always worked on desktop - the loopback flow is pure MSAL.NET
and the skia flavour's no-op WithUnoHelpers() is the correct behaviour
there - and Microsoft.Identity.Client.Extensions.Msal is specifically
the desktop token-cache helper, so desktop is the head that needs these
pins most. Marking it supported makes the feature resolve the same
SDK-pinned versions as every other head.

Verified with a desktop-only AuthenticationMsal app on Uno.Sdk
6.8.0-dev.12: as shipped it resolves Uno.WinUI.MSAL/6.0.465; with
-p:IsMSALSupported=true it resolves Uno.WinUI.MSAL/6.8.0-dev.22 and
Microsoft.Identity.Client(.Extensions.Msal)/4.87.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019BJKK7KeJ14DVxxW5UmJqo
@kazo0
kazo0 marked this pull request as ready for review August 14, 2026 19:43
Copilot AI lite review requested due to automatic review settings August 14, 2026 19:43

Copilot AI 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.

Pull request overview

This PR updates the Uno SDK’s desktop target configuration so the AuthenticationMsal UnoFeature resolves the same SDK-pinned MSAL package versions on netX.0-desktop as it already does on Android/iOS/WASM/WinAppSDK. This addresses version drift caused by relying on transitive “nuspec floor” versions on desktop.

Changes:

  • Set IsMSALSupported=true for the desktop target (Uno.Common.Desktop.targets) to enable the MSAL implicit references gate for desktop builds.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24084/wasm-skia-net9/index.html

@mergify

mergify Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@MartinZikmund
MartinZikmund merged commit eaa505e into master Aug 15, 2026
71 checks passed
@MartinZikmund
MartinZikmund deleted the dev/sb/msal-desktop-supported branch August 15, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants