Repository navigation
feat(skills): add uno-authentication hub - #182
Merged
Merged
Conversation
kazo0
requested review from
agneszitte,
carldebilly,
ebariche and
jeromelaban
as code owners
October 8, 2026 01:14
Contributor
Author
|
@Mergifyio rebase |
Agents asked for sign-in wrote their own auth service and token storage. The new hub routes them to Uno.Extensions.Authentication: custom, MSAL, OIDC and web providers, the login/logout navigation flow, and the access token on Refit and Kiota clients. Its critical rules cover what the docs and the 6.8 template get wrong, checked against the Uno.Extensions 7.4 source: the custom template stores the password with the tokens, the recommended template never handles LoggedOut, Refit needs HttpRefit (not Http), the OIDC option is AutoRedirectUriFromWebAuthenticationBroker, and the Android redirect activities use a placeholder scheme. The router, uno-build-app, the uno-dev agent, the READMEs and the manifest descriptions now list the hub. Refs #178 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0174z2Vobf7pXT4VUMUZxczA
✅ Branch has been successfully rebased |
kazo0
force-pushed
the
feat/uno-authentication-skill
branch
from
October 9, 2026 15:59
e0593fd to
edabf8e
Compare
- flow.md: subscribe to LoggedOut after the first navigation. A RefreshAsync that cannot renew stored tokens clears them and raises LoggedOut, so the earlier subscription sent an expired session to the login page twice. - msal.md, msal-platforms.md: use a <client-id> placeholder instead of a real-looking GUID that agents would copy into apps. - http.md: the Refit section name drops every leading I or i (IIdentityApi reads "dentityApi"); pass name: to AddRefitClient then. Refs #178 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018n3XbSQngpLmbiRhN6cLNu
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
rajamatt
approved these changes
Oct 23, 2026
…L keeps its platform redirect URIs Re-checked every claim against the versions main targets instead of the 6.8/7.4 line the skill was written on: the public auth, HTTP, Refit and Kiota API of Uno.Extensions 8.0.0-dev.85 decompiled next to 7.4.0-dev.103 (no difference), and one app per `-auth` value generated with Uno.Templates 7.0.0-dev.77 (every template gap the skill lists is still there). What changed: - MSAL: the template's `appsettings.development.json` sets `RedirectUri: myprotocol://auth`, and every Debug build loads it. The skill said to replace `myprotocol` everywhere; a configured `RedirectUri` is `ConfigurationSupplied` in `MsalRedirectDefaults.Apply` and skips the per-platform defaults on every head, so that broke iOS, WebAssembly and desktop. The rule is now to delete the key from both appsettings files. - MSAL: `KeychainSecurityGroup`, which the template writes, binds to nothing in `MsalConfiguration` or MSAL's `PublicClientApplicationOptions`; say so and point at the entitlements and `WithIosKeychainSecurityGroup`. - OIDC: the description promised Google; `oidc.md` now covers its two traps. Google's discovery document has no `end_session_endpoint`, so `LogoutAsync` throws after the tokens are cleared (OidcClient 6.0.1 `EndSessionAsync`, and `AuthenticationService.LogoutAsync` clears then rethrows), and its redirect URI rules differ per client type. - Version lines moved to Uno.Extensions 8.0.0-dev.85 / Uno.Sdk 7.0.0-dev.77 / Uno.Templates 7.0.0-dev.77. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
… keeps the MSAL Android and iOS scheme fixes Google accepts a custom-scheme redirect as the reverse DNS of a domain you control or of the client ID, not only the latter. The MSAL critical rule now says the Android activity and Info.plist still get their schemes; only the appsettings `RedirectUri` key is deleted rather than filled. Also verified since the previous commit: the parameterless `EmbeddedSource<App>()` adds `appsettings.<environment>.json` (so the Debug build reads the development file), `UnoUIApplicationDelegate` and `UseUIApplicationDelegate<T>` exist in Uno.WinUI.Runtime.AppleUIKit 7.0.0-dev.2332, and the custom-login, `LoggedOut` and `LoginModel` snippets build on the desktop head of an app generated with Uno.Templates 7.0.0-dev.77 with no warnings. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
… MSAL sample
Checked against Uno.Samples/UI/Authentication.MsalExtensionsDemo, the sample
the skill names as its reference. The sample confirms the appsettings
`RedirectUri` deletion and that no configuration key sets the iOS keychain
group. What it corrected:
- Android registers `msal{ClientId}://auth` as a custom redirect URI under
Mobile and desktop applications, not under the portal's Android option
(which generates the broker `msauth://{package}/{hash}` form); iOS uses the
iOS/macOS option with the bundle ID; WinAppSDK registers
`ms-appx-web://microsoft.aad.brokerplugin/{ClientId}`.
- `MsalActivity` uses `LaunchMode.SingleTop`, as the template and sample do.
- The registration needs Allow public client flows; `TenantId` must match the
supported account types (`consumers` is personal accounts only).
- WebAssembly: the popup must not be blocked, no Cross-Origin-Opener-Policy,
and the host rewrites `/authentication-callback` to `index.html`; wrong
platform type fails with AADSTS90023.
- iOS: an incremental build can skip `Info.plist` and `Entitlements.plist`
edits; delete bin/obj for the iOS target after changing them.
- `InteractiveTimeout` `00:00:00` waits forever; `TokenAsync` is null after
sign-out.
To stay under the reference budget, the `OnActivityResult` snippet the
template already contains is now one sentence, and the Mac Catalyst note
lives only in msal.md.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
…e Uno.Samples OIDC sample Dogfooded the skill by building UI/Authentication.OidcExtensionsDemo on Uno.Sdk 7.0.0-dev.77 against the Duende demo server, desktop and Android verified end to end. What the skill got wrong or left out: - Skia desktop: Uno's WebAuthenticationBroker is not implemented there, so AddOidc's default browser throws NotImplementedException and LoginAsync returns false. The app has to register its own IBrowser with a loopback listener. New reference oidc-platforms.md carries this, with the Android intent-filter and iOS CFBundleURLTypes snippets. - Code configuration replaces the whole OidcAuthentication section rather than overriding one value (Settings.Options ?? Configuration.Get(name)), so a per-platform redirect override goes through configuration. - LogoutAsync sends no id_token_hint or state, waits up to 300 s for a post-logout redirect most identity providers will not send without the hint, and then clears the tokens whatever the browser returned. flow.md no longer claims a cancel path that keeps the tokens for OIDC. - The docs search phrase for OIDC returned the pre-Extensions IdentityModel guide; the reference now names the Uno.Extensions how-to paths. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
…when switching to HttpRefit Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
…ration must go Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
…er shipped in Uno.Extensions 8.0.0-dev.135 AddOidc and AddWeb now register DesktopWebAuthenticationBrokerProvider on desktop (uno.extensions#3261, published as 8.0.0-dev.135), the OIDC provider sends the cached ID token as id_token_hint on every head, and app cancellation surfaces as OperationCanceledException. No Uno.Sdk pins dev.135 yet, so the guidance is version-gated: a new references/oidc-desktop.md holds the version check, the opt-in (UnoExtensionsVersion plus Uno.Sdk 7.0.0-dev.89, the Debug-only Uno.WinUI.Lottie reference for uno.extensions#3262), the loopback redirect URI, the first-registration ordering rule, logging, and the pre-dev.135 IBrowser workaround. oidc-platforms.md, oidc.md, web.md, flow.md and SKILL.md point at it and drop the claims the fix made wrong. Verified by running the Uno.Samples OIDC sample on desktop and WebAssembly against the published package. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
…clears the tokens Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
…udget Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
…mong the verified heads Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PZQ75jhwM9sq6XMMnSCUEt
…eb sample; Uno.Sdk 7.0.0-dev.95+ pins the desktop broker Dogfooded the skill by building UI/Authentication.WebExtensionsDemo in Uno.Samples from dotnet new unoapp -preset recommended -auth Web -server on Uno.Templates/Uno.Sdk 7.0.0-dev.115, verified on desktop, WebAssembly and Android. What the skill got wrong or left out: - Version gate: Uno.Sdk 7.0.0-dev.95 and later pin Uno.Extensions 8.0.0-dev.147+ (7.0.0-dev.113+ pin dev.150), so desktop sign-in needs no UnoExtensionsVersion override there. The Debug-only Uno.WinUI.Lottie workaround is still needed on 7.0.0-dev.115 (Uno.UI.HotDesign 2.0.0-dev.31); without it the desktop app hangs with no window rather than throwing. - web.md: a state check needs AddWeb<TService>, the only PostLogin that gets the callback URL. On WebAssembly the Web provider sends the configured callback (unlike AddOidc), so it has to be set to the broker's callback through configuration. Without Refresh, RefreshAsync reports success while tokens exist; a Refresh callback that throws makes RefreshAsync throw with the tokens kept, which the template's InitialNavigate does not catch. LogoutAsync clears the tokens whatever the browser returned. Fragment responses work on desktop. Adds the docs paths. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PZQ75jhwM9sq6XMMnSCUEt
…escapes InitialNavigate Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PZQ75jhwM9sq6XMMnSCUEt
…a Custom sample with Kiota Dogfooded by building UI/Authentication.CustomExtensionsDemo in Uno.Samples from dotnet new unoapp -preset recommended -auth custom -server on Uno.Sdk 7.0.0-dev.115, with the Kiota client the template ships, verified on desktop, WebAssembly and Android. custom.md held up; what it lacked: - The recommended template uses Kiota, but custom.md only showed Refit. http.md now gives the Kiota no-refresh header (request configuration), the Kiota error type (ApiException.ResponseStatusCode), and how to regenerate the checked-in client after an API change. - LogoutAsync clears the tokens and raises LoggedOut before rethrowing a Logout callback's exception; RefreshAsync keeps them. - The docs walkthrough's Refit example also returns the credentials dictionary (storing the password) and lists only the Http feature. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PZQ75jhwM9sq6XMMnSCUEt
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PZQ75jhwM9sq6XMMnSCUEt
This was referenced Oct 31, 2026
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.
Refs #178
Summary
Adds
uno-authentication, a hub skill for Uno.Extensions.Authentication. It has a shortSKILL.mdand nine references that load only when needed, each under the 6,000-character budget.custom.mdAddCustom/AddCustom<TService>, and a local prototype checkmsal.mdAddMsal(window)msal-platforms.mdspaplatformoidc.mdAddOidc: configuration, code options, Google, logout and cancellation behaviouroidc-platforms.mdCFBundleURLTypes, the WebAssembly callbackoidc-desktop.mdweb.mdAddWebflow.mdLoggedOut, optional sign-inhttp.mdNoRefresh, cookies, reading tokensFor a new app the skill starts from
dotnet new unoapp -preset recommended -auth <custom|msal|oidc|Web>, then has the agent fix the gaps in the generated code. It also registers the hub everywhere the others are listed:uno-platformrouter and its new-app section;uno-build-app, including the-authflag innew-app.md;uno-devagent, in both its Markdown and Codex files;plugin.jsonand the marketplace descriptions.What the rules are grounded in
Every behaviour claim was checked against the decompiled Uno.Extensions 8.0.0-dev.85 packages (the version Uno.Sdk 7.0.0-dev.77 pins) and the Uno.Templates 7.0.0-dev.77 output, then re-checked where 8.0.0-dev.135 changed them; the Web guidance was re-checked against 8.0.0-dev.150 and Uno.Templates 7.0.0-dev.115. The main ones:
Loginreturns is persisted.LoggedOutonce, for the life of the app. It fires on logout, on a failed refresh, and on a 401 that a refresh can't fix.AddRefitClient,AddKiotaClient,AddClient).NoRefresh.LogoutStartUrito sign out; OIDC needsoffline_accessto stay signed in across restarts; any OIDC code option replaces the whole configuration section; MSAL takes the window and a dispatcher, and aRedirectUriin appsettings replaces the per-platform defaults on every head.AddOidcandAddWebregister a loopbackWebAuthenticationBroker, sends the cached ID token asid_token_hinton sign-out, and surfaces app cancellation asOperationCanceledException. Uno.Sdk 7.0.0-dev.95 and later pin a version that has it (7.0.0-dev.113+ pin 8.0.0-dev.150).oidc-desktop.mdgives the version check, the opt-in for an older Sdk (UnoExtensionsVersionplus Uno.Sdk 7.0.0-dev.89), the Debug-onlyUno.WinUI.Lottiereference still needed through at least Uno.Sdk 7.0.0-dev.115 ([Navigation] Uno.Extensions.Navigation.Toolkit still references Uno.UI.Lottie, so Recommended apps on Uno.Sdk 7.0.0-dev.89 fail to initialize (FileNotFoundException) uno.extensions#3262), the first-registration ordering rule, and theIBrowserworkaround for older versions.How it was tested
.github/scripts/Test-Plugin.ps1passes;claude plugin validate --strictandagentskills validatepassed on the earlier revisions.UI/Authentication.MsalExtensionsDemoin Uno.Samples.UI/Authentication.OidcExtensionsDemoin Uno.Samples from the skill alone (unoplatform/Uno.Samples branchdev/sb/oidc-extensions-demo), recording every place the skill was wrong, and fixing it. The sample runs end to end against the Duende demo server on desktop (Skia), WebAssembly, Android and an iOS 18.5 simulator. Desktop, WebAssembly and iOS were re-run against the published Uno.Extensions 8.0.0-dev.135.UI/Authentication.WebExtensionsDemo(unoplatform/Uno.Samples branchdev/sb/web-extensions-demo, with its own ASP.NET Core backend) fromdotnet new unoapp -preset recommended -auth Web -serveron Uno.Sdk 7.0.0-dev.115. Verified end to end on desktop (Windows), WebAssembly and an Android API 36 emulator: sign-in, thestatecheck refusing a forged loopback callback, 401 →Refresh→ retry, silent sign-in after a restart, sign-out, and both refresh failure modes (backend down, refresh token rejected). That pass fixed the stale version gate, the WebAssembly callback, theAddWeb<TService>requirement for astatecheck, theRefreshexception semantics, andLogoutAsyncclearing the tokens whatever the browser returned. iOS was then verified on an iPhone 16 simulator (iOS 18.5).UI/Authentication.CustomExtensionsDemo(unoplatform/Uno.Samples branchdev/sb/custom-extensions-demo, with its own backend) fromdotnet new unoapp -preset recommended -auth custom -server, keeping the Kiota client the template ships. Verified on desktop, WebAssembly and Android: a wrong password failing the sign-in,Loginstoring only the tokens, 401 →Refresh→ retry through Kiota with theNo-Refreshheader, silent sign-in after a restart, sign-out revoking the refresh token, a rejected refresh ending the session without a loop, and a failingLogoutcallback still clearing the tokens. That pass added the Kiota specifics tohttp.mdand the exception semantics tocustom.md. iOS was then verified on an iPhone 16 simulator (iOS 18.5).Not done:
UnoUIApplicationDelegate.OpenUrlsnippet inmsal-platforms.mdhas not been checked against the 7.0 template's scene-delegate lifecycle.Upstream
LoggedOuthandler, the misplaced iOS URL scheme and themyprotocolplaceholders). Uno.Templates 7.0.0-dev.115 still generates all of them for-auth Web. The skill text should be revisited when those are fixed, and the opt-in inoidc-desktop.mddropped once apps on Uno.Sdk older than 7.0.0-dev.95 no longer matter.🤖 Generated with Claude Code
https://claude.ai/code/session_01Sn8GmJ41W3eBgT7866J3jV
https://claude.ai/code/session_01PZQ75jhwM9sq6XMMnSCUEt