Skip to content

fix(web): name every callback source when a flow cannot start - #3167

Merged
kazo0 merged 1 commit into
dev/sb/auth-providers-fixesfrom
dev/sb/web-callback-diagnostics
Aug 26, 2026
Merged

kazo0 merged 1 commit into
dev/sb/auth-providers-fixesfrom
dev/sb/web-callback-diagnostics

Conversation

@kazo0

@kazo0 kazo0 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): closes #

Stacked on dev/sb/auth-providers-fixes — this continues spec 014, which is not on main yet.

PR Type

  • Bugfix

What is the current behavior?

When neither configuration nor the start URI nor the platform broker yields a callback URI, sign-in and sign-out cannot start. The warning named only the first two sources:

LoginCallbackUri not specified and redirect_uri not set in LoginStartUri, unable to start login flow

That reads as a configuration slip even when the start URI does carry {RedirectUri} and the real cause is a platform with no callback to derive. The broker's own failure message was logged at Debug — invisible at the level an app actually runs with — so the one line explaining the dead end never appeared.

Found the hard way on an iOS head whose Info.plist declared CFBundleURLSchemes at the root instead of inside CFBundleURLTypes, so iOS ignored the custom scheme entirely. The app reported "redirect_uri not set", which is the one thing that was not wrong.

What is the new behavior?

GetBrokerCallbackUri becomes TryGetBrokerCallbackUri, returning the broker's message alongside the (null) URI instead of logging it at Debug and dropping it. The caller folds it into a single Warning that names all three sources tried and says what makes a broker-derived callback possible:

Unable to start login flow: LoginCallbackUri is not configured and LoginStartUri carries no
redirect_uri value (the {RedirectUri} placeholder is replaced with the callback, it is not one),
and WebAuthenticationBroker could not derive one for this platform: <broker's message>.
A broker-derived callback needs a custom scheme registered for the app -
CFBundleURLTypes/CFBundleURLSchemes in Info.plist on iOS and Mac Catalyst, an intent filter on
Android - or configure the callback explicitly

The reason travels back to the caller rather than being logged where it happens, because the broker is the last source tried: reported at the call site it is visible at Warning level, where the flow being over makes it worth saying. Both the login and logout paths get the same treatment.

Purely diagnostic — no change to which callback is chosen or how a flow runs.

specs/014-web-redirect-defaults/spec.md gains a Diagnostics section recording the cause and the guard.

Verification

StubWebAuthenticationBroker gains a CallbackUriError that makes GetCurrentApplicationCallbackUri throw the way a real broker does on a platform with no callback. When_BrokerCannotDeriveCallback_Then_WarningNamesBroker asserts the flow does not start, the broker UI never opens, and the warning carries both the broker's name and its reason.

Executed locally on the Skia desktop runtime-test head, not just compiled:

UNO_RUNTIME_TESTS_RUN_TESTS='{"Filter":{"Value":"Given_WebAuthentication"}}' \
  dotnet Uno.Extensions.RuntimeTests.dll

Given_WebAuthentication: 10 total, 10 passed, 0 failed — the 9 existing cases plus the new one.

PR Checklist

  • Tested code with current supported SDKs
  • Docs have been added/updated which fit documentation template (for bug fixes / features)
  • Unit Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Wasm UI Tests are not showing unexpected any differences. Validate PR Screenshots Compare Test Run results.
  • Contains NO breaking changes
  • Updated the Release Notes

Notes on the checklist:

  • Docs unticked deliberately: this changes the text of a log message, not documented behavior or public API. The rationale lives in the spec and in the code comments. Happy to add a troubleshooting entry to the web-authentication how-to if reviewers would rather it were user-facing.
  • Release Notes unticked for the same reason — no behavior to announce.
  • No breaking changes — the only observable difference is the wording and log level at which an already-failing flow explains itself.
  • Wasm UI Tests unchecked pending CI; nothing visual changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RhtkcHHpbm6XiDagFY6VaS

When neither configuration nor the start URI nor the platform broker yields
a callback URI, sign-in and sign-out cannot start. The warning named only
the first two sources:

    LoginCallbackUri not specified and redirect_uri not set in LoginStartUri

which reads as a configuration slip even when the start URI does carry
{RedirectUri} and the real cause is a platform with no callback to derive.
The broker's own failure message was logged at Debug - invisible at the
level an app actually runs with - so the one line explaining the dead end
never appeared.

Found the hard way on an iOS head whose Info.plist declared
CFBundleURLSchemes at the root instead of inside CFBundleURLTypes, so iOS
ignored the scheme entirely. The app reported "redirect_uri not set", which
is the one thing that was not wrong.

GetBrokerCallbackUri becomes TryGetBrokerCallbackUri, returning the broker's
message alongside the (null) URI rather than logging it at Debug and
dropping it. The caller folds it into a single Warning that names all three
sources tried and says what makes a broker-derived callback possible - a
custom scheme registered for the app, CFBundleURLTypes/CFBundleURLSchemes in
Info.plist on iOS and Mac Catalyst, an intent filter on Android. The reason
travels to the caller rather than being logged at the source because that is
the last source tried: reported there, it is visible at Warning level, where
the flow being over makes it worth saying.

Both the login and logout paths take the same treatment.

Guarded by Given_WebAuthentication.When_BrokerCannotDeriveCallback_Then_
WarningNamesBroker, with StubWebAuthenticationBroker gaining a
CallbackUriError that makes GetCurrentApplicationCallbackUri throw the way a
real broker does on a platform with no callback. The test asserts the flow
does not start, the broker UI never opens, and the warning carries both the
broker's name and its reason.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RhtkcHHpbm6XiDagFY6VaS
@mergify

mergify Bot commented Aug 26, 2026

Copy link
Copy Markdown

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

  • Queue this pull request

@kazo0
kazo0 merged commit 981f2f9 into dev/sb/auth-providers-fixes Aug 26, 2026
5 checks passed
@kazo0
kazo0 deleted the dev/sb/web-callback-diagnostics branch August 26, 2026 17:42
kazo0 added a commit that referenced this pull request Aug 26, 2026
- Web and OIDC pages now say where tokens are stored (the host's default
  IKeyValueStorage, per platform) and that an unencrypted store is reported
  by a startup Warning, linking to the storage overview's table
- OIDC on Skia Desktop: the provider does not derive the redirect URI by
  default there, so the bullet now names the two options - a fixed
  RedirectUri or AutoRedirectUriFromWebAuthenticationBroker()
- fix the method name on the OIDC page and walkthrough
  (AutoRedirectUriFromAuthenticationBroker never existed)
- Web platform matrix links the Android intent filter and the iOS
  CFBundleURLTypes setup, the malformed-plist cause behind #3167
- Skia Desktop: say how to pin the loopback port and name the
  DefaultCallbackPath / DefaultReturnUri knobs the broker honors
- upgrade notes: one bullet for the new unencrypted-store Warning

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BqwJ47NVrvRR9Ghjc4Ti7X
kazo0 added a commit that referenced this pull request Sep 11, 2026
- Web and OIDC pages now say where tokens are stored (the host's default
  IKeyValueStorage, per platform) and that an unencrypted store is reported
  by a startup Warning, linking to the storage overview's table
- OIDC on Skia Desktop: the provider does not derive the redirect URI by
  default there, so the bullet now names the two options - a fixed
  RedirectUri or AutoRedirectUriFromWebAuthenticationBroker()
- fix the method name on the OIDC page and walkthrough
  (AutoRedirectUriFromAuthenticationBroker never existed)
- Web platform matrix links the Android intent filter and the iOS
  CFBundleURLTypes setup, the malformed-plist cause behind #3167
- Skia Desktop: say how to pin the loopback port and name the
  DefaultCallbackPath / DefaultReturnUri knobs the broker honors
- upgrade notes: one bullet for the new unencrypted-store Warning

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BqwJ47NVrvRR9Ghjc4Ti7X
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.

1 participant