Repository navigation
feat(samples): add the MSAL authentication extensions demo - #948
Merged
Merged
Conversation
A single-project Uno app demonstrating Uno.Extensions MSAL authentication across Desktop, WebAssembly, Android and iOS, built to make the parts that are usually invisible visible. - A flow log narrates every IAuthenticationService call - the silent startup refresh, interactive sign-in, token summaries, sign-out - so the order of operations a real app follows is readable as it happens. - A Platform setup page explains what each head needs and why: the redirect URI convention per platform and the app-registration platform type it must be registered under (WebAssembly must be a single-page application), the Android intent-filter scheme, the iOS CFBundleURLTypes entry, and the keychain-access-groups entitlement without which MSAL cannot write its token cache. - The Sign in page shows the exact redirect URI the running head will use, which is the value that has to match the registration. - A Graph call (User.Read) proves the acquired token actually works. - A Redact switch hides everything identifying the app registration or the signed-in user, so the app can be screen-shared or recorded. Configuration follows the appsettings pattern: put the client ID and tenant in appsettings.development.json. The committed file carries an empty ClientId - with none configured the app starts and explains what is missing rather than throwing. Packages come from the public feeds: Uno.Sdk 6.8.0-dev.23 and UnoExtensionsVersion 7.4.0-dev.29, both resolved from the uno dev feed in the repo root NuGet.config. That version carries the MSAL token-cache and redirect work the demo relies on, so there is no local feed and no sibling checkout to arrange. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01RhtkcHHpbm6XiDagFY6VaS
kazo0
force-pushed
the
dev/sb/msal-extensions-demo
branch
from
August 26, 2026 14:48
4c26247 to
b1bacfd
Compare
kazo0
marked this pull request as ready for review
August 26, 2026 15:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
UI/Authentication.MsalExtensionsDemo, a single-project Uno app demonstrating Uno.Extensions MSAL authentication across Desktop, WebAssembly, Android and iOS.What it demonstrates
MSAL's hard parts are the ones you cannot see from the outside: which redirect URI a head actually uses, what the app registration has to say about it, and where the token cache lives. The app surfaces each of those.
IAuthenticationServicecall as it happens: the silent startup refresh, interactive sign-in, token summaries, sign-out. The order of operations a production app follows becomes readable rather than inferred.AADSTS90023), the Android intent-filter scheme, the iOSCFBundleURLTypesentry, and thekeychain-access-groupsentitlement without which MSAL cannot write its token cache and sign-in ends inmissing_entitlements.User.Read) — proves the acquired token actually works, rather than stopping at "sign-in returned true".Configuration
Standard appsettings pattern: client ID and tenant go in
appsettings.development.json. The committed file carries an emptyClientId— with none configured the app starts and explains what is missing rather than throwing, which is also what makes it safe to commit.Platforms/Android/MsalActivity.Android.cskeeps the existing all-zeros GUID placeholder for the intent-filter scheme; the ReadMe covers both.Packages
Everything resolves from the public feeds already configured in the repo root
NuGet.config— no local feed, no sibling checkout to arrange:Uno.Sdk6.8.0-dev.23UnoExtensionsVersion7.4.0-dev.297.4.0-dev.29carries the MSAL token-cache and redirect work the demo relies on — verified against the resolved assembly:MsalStorageDefaults,GetMacKeychainServiceName,AllowUnprotectedTokenCacheFallbackandMsalRedirectDefaultsare all present.One known gap: that version predates the macOS keychain-prompt fix (uno.extensions#3166), so on macOS the demo still raises three keychain-access prompts at every launch —
MsalCacheHelper.VerifyPersistence()probing with a keychain entry whose service name MSAL randomizes each run, which is why "Always Allow" never sticks. BumpingUnoExtensionsVersiononce that ships takes it to zero. It does not affect the demo's correctness on any platform, only how noisy macOS startup is.Verification
Clean restore and build against the public feeds only, with
obj/andbin/removed first:That also confirms the sample is self-contained — nothing it needs was left behind on the branch it was split from.
The desktop head has been run end to end on macOS (sign-in, Graph call, silent refresh across restart, sign-out).
Notes for reviewers
masterrather than split from the working branch, so the development history (and a real client ID that had been committed there) stays out of this one. Single commit, 84 files, all new.HANDOFF-MACOS.mdis deliberately excluded — an internal handoff document, not sample material.🤖 Generated with Claude Code
https://claude.ai/code/session_01RhtkcHHpbm6XiDagFY6VaS