docs: Rework the Authentication core and platform pages for 4.0 - #728
Open
developerjamiu wants to merge 2 commits into
Open
docs: Rework the Authentication core and platform pages for 4.0#728developerjamiu wants to merge 2 commits into
developerjamiu wants to merge 2 commits into
Conversation
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.
First of three PRs reworking the Authentication section for 4.0. This one covers the core and platform pages. Providers and the legacy section follow separately.
Every framework claim here was verified against
serverpod/serverpodat 4.0.0-beta.1.Structure
01-get-started.mdand01-setup.mdboth carried the01-prefix, so sidebar order depended on an alphabetical tiebreak. The pages are renumbered so each number is used once. Slugs strip numeric prefixes, so no URLs change.The macOS authentication page from #665 is now
09-, keeping the order that PR intended (profile photos, then macOS, then custom overrides). Its three inbound notes are preserved in the rewritten pages.Correctness
The larger fixes:
basicscheme and that unrecognized schemes reach your handler. Neither is true. The client sends whateverauthHeaderValuereturns, the built-in module usesbearer, and the server accepts onlyBearer,Basic, andDigest, rejecting anything else with a 400 unlessvalidateHeadersisfalse.'valid'withwrapAsBasicAuthHeaderValue, butBasicrequires the decoded value to beusername:passwordwith both parts non-empty, so the request was rejected with a 400 before reaching the handler. Switched towrapAsBearerAuthHeaderValue, which matches what the built-in module does.googleClientSecretshowed a service account JSON. The framework parses the OAuth client JSON with awebsection and throws at startup otherwise.FlutterWebAuth2CallbackRouteonly works when the app is on the same origin.AuthServices.getTokenManager<T>()is static, not an instance member.userProfileextension throwsUserProfileNotFoundExceptionrather than returningnullwhen a signed-in user has no profile.JwtConfigFromPasswordssupports HMAC SHA-512 only.defaultUserImageGeneratordraws a square, not a circle.AuthUsers.deletenamed parameter, the module pathclient.modules.serverpod_auth_core.status, and theAuthenticationInfocontract (userIdentifieris aString,authIdis required).4.0.0-beta.0to4.0.0-beta.1.Currency
The provider list named four of the nine shipped providers. It now names all nine and marks the two experimental ones.
FlutterWebAuth2CallbackRouteis documented as an alternative to hand-creatingauth.html. The shared button styling API (SignInWidget.buttonStyle) is documented, replacing per-provider enums that no longer exist.Readability
Jargon that was never explained now is, at first use: pepper, identity provider, access versus refresh tokens, and the difference between the
Sessionrequest object and an auth session. The token managers page gained a comparison table so the choice between JWT and server-side sessions is answerable on the page that presents it.Duplicated content was given a single owner and a pointer: the
SignInWidgetexample, the default user image configuration, and the do-not-navigate warning. Every page ends with a Related block.Verification
Two adversarial review passes ran over this change: one over the rework, one over the fixes made in response to the first. The second pass caught nine problems in the first pass's own corrections, including the broken
basicexample above.npm run buildpasses.