Repository navigation
docs(authentication): fix API names and samples that do not compile - #3212
Merged
Merged
Conversation
- 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
Contributor
Author
|
@Mergifyio backport servicing/7.4 |
✅ Backports have been createdDetails
|
3 of 7 tasks
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)
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.
GitHub Issue (If applicable): related to unoplatform/uno.templates#2306
PR Type
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:
.AutoRedirectUriFromAuthenticationBroker(), which does not exist. The method isAutoRedirectUriFromWebAuthenticationBroker().AddOidc(), butAddOidc()returnsIAuthenticationBuilder. The OIDC options belong in itsconfigurecallback. TheDisablePushedAuthorization = falsesample was commented "Disable the PAR endpoint", which is the opposite of what it does.PostLogin: the samples usePostLogin(async (authService, tokens, ct) => ...), which matches no overload onAddWeb.LoginCallbackUri: the configuration samples omit it, and neitherLoginStartUricarries aredirect_uri. With that configuration the provider logs a warning and login fails.LoginAsync, and a refresh needs aRefreshcallback.Http"to access Refit", but Refit comes withHttpRefit.UseHttpsample: it names the lambda parameterservicesand then useshttp.Login: the samples add the token tocredentialsand 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.mdAuthentication/HowTo-OidcAuthentication.mdAuthentication/HowTo-WebAuthentication.mdWalkthrough/Authentication.howto.mdWalkthrough/Authentication.Oidc.howto.mdWalkthrough/Authentication.Web.howto.mdThe fixes:
AddOidc(oidc => oidc...), and the PAR sample now matches its comment.PostLogin(async (tokens, ct) => ...), with a sentence on the other overloads.LoginCallbackUriis added to the configuration samples and explained. The how-to says that logout needsLogoutStartUriand that a refresh needs aRefreshcallback.HttpRefitinstead ofHttpand the correctedUseHttpparameter.Loginreturns a new dictionary holding onlyTokenCacheExtensions.AccessTokenKey, with a note on why.PR Checklist
net10.0-desktop.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