Skip to content

docs(authentication): fix API names and samples that do not compile - #3212

Merged
kazo0 merged 1 commit into
mainfrom
dev/sb/auth-docs-fixes
Oct 8, 2026
Merged

kazo0 merged 1 commit into
mainfrom
dev/sb/auth-docs-fixes

Conversation

@kazo0

@kazo0 kazo0 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): related to unoplatform/uno.templates#2306

PR Type

  • Documentation content changes

What is the current behavior?

Several authentication samples in the how-to and walkthrough pages don't compile against Uno.Extensions 7.4, or they lead to an app that fails at runtime:

  • OIDC auto redirect: the docs call .AutoRedirectUriFromAuthenticationBroker(), which does not exist. The method is AutoRedirectUriFromWebAuthenticationBroker().
  • OIDC builder chaining: the samples chain OIDC options after AddOidc(), but AddOidc() returns IAuthenticationBuilder. The OIDC options belong in its configure callback. The DisablePushedAuthorization = false sample was commented "Disable the PAR endpoint", which is the opposite of what it does.
  • Web PostLogin: the samples use PostLogin(async (authService, tokens, ct) => ...), which matches no overload on AddWeb.
  • Web LoginCallbackUri: the configuration samples omit it, and neither LoginStartUri carries a redirect_uri. With that configuration the provider logs a warning and login fails.
  • Web behavior: the how-to says the provider redirects to login automatically and refreshes tokens on its own. Neither happens: login starts on LoginAsync, and a refresh needs a Refresh callback.
  • Refit feature: the custom authentication pages add Http "to access Refit", but Refit comes with HttpRefit.
  • UseHttp sample: it names the lambda parameter services and then uses http.
  • Custom Login: the samples add the token to credentials and return it. The returned dictionary is persisted, so this stores the user's password.

What is the new behavior?

Six pages are fixed:

  • Authentication/HowTo-Authentication.md
  • Authentication/HowTo-OidcAuthentication.md
  • Authentication/HowTo-WebAuthentication.md
  • Walkthrough/Authentication.howto.md
  • Walkthrough/Authentication.Oidc.howto.md
  • Walkthrough/Authentication.Web.howto.md

The fixes:

  • OIDC: the correct method name, with the options set inside AddOidc(oidc => oidc...), and the PAR sample now matches its comment.
  • Web: PostLogin(async (tokens, ct) => ...), with a sentence on the other overloads. LoginCallbackUri is added to the configuration samples and explained. The how-to says that logout needs LogoutStartUri and that a refresh needs a Refresh callback.
  • Custom: HttpRefit instead of Http and the corrected UseHttp parameter. Login returns a new dictionary holding only TokenCacheExtensions.AccessTokenKey, with a note on why.

PR Checklist

  • Tested code with current supported SDKs: the corrected custom, Web and OIDC snippets compile in apps generated with Uno.Templates 6.8.0-dev.30 (Uno.Extensions 7.4.0-dev.29), built for net10.0-desktop.
  • Docs have been added/updated: n/a, docs-only change
  • Unit Tests and/or UI Tests: n/a
  • Wasm UI Tests: n/a
  • Contains NO breaking changes
  • Updated the Release Notes: n/a
  • Associated with an issue

Other information

Found while writing the Uno.Extensions.Authentication agent skill (unoplatform/studio#178). The issues in the generated template code are filed separately in unoplatform/uno.templates#2306.

🤖 Generated with Claude Code

https://claude.ai/code/session_0174z2Vobf7pXT4VUMUZxczA

- OIDC: the method is AutoRedirectUriFromWebAuthenticationBroker, and
  builder options are set through the AddOidc configure callback, since
  AddOidc returns IAuthenticationBuilder.
- Web: PostLogin has no (service, tokens, ct) overload on AddWeb; document
  LoginCallbackUri, without which login fails; logout needs LogoutStartUri;
  tokens are refreshed only with a Refresh callback.
- Custom: Refit needs the HttpRefit feature, fix the UseHttp lambda
  parameter, and return only the tokens from Login instead of the
  credentials dictionary, which stored the password.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0174z2Vobf7pXT4VUMUZxczA
@kazo0

kazo0 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio backport servicing/7.4

@mergify

mergify Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

backport servicing/7.4

✅ Backports have been created

Details

@kazo0
kazo0 merged commit 197442b into main Oct 8, 2026
13 of 14 checks passed
@kazo0
kazo0 deleted the dev/sb/auth-docs-fixes branch October 8, 2026 13:37
kazo0 added a commit that referenced this pull request Oct 8, 2026
…-3212

docs(authentication): fix API names and samples that do not compile (backport #3212)
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