Class LoginDivBuilder
AuthMethods.
The server decides what login looks like — which providers, whether a password form is offered —
so adding an IdP needs no client change.
SSO options are plain DivKit buttons (a tap is just a redirect, so an opaque
onno://auth/sso/{id} action suffices). Username/password capture, however, needs to read
the typed values on submit — which a DivKit action can't do — so it is delegated to the
onno-login-form custom block (a React widget), mirroring how onno-form handles
rich entity forms elsewhere.
When more than one kind of method is available (a password and at least one SSO
provider) the screen is split into two steps so it stays uncluttered: step one is a picker of
equal-width method buttons (each SSO provider plus a "Sign in with password" button), and choosing
password advances to step two, which shows only the credentials form behind a back link. The
client re-requests the card with ?step=password on selection (and back to the picker on
onno://auth/back). A single-kind screen (password-only or SSO-only) skips the picker and
renders inline as before.
-
Method Summary
Modifier and TypeMethodDescriptionlogin(AuthMethods methods, Palette p) Back-compat overload rendering the English defaults (used by unit tests).login(AuthMethods methods, Palette p, UiMessages msg) login(AuthMethods methods, Palette p, UiMessages msg, String step) Back-compat overload: no demo accounts.login(AuthMethods methods, Palette p, UiMessages msg, String step, List<Map<String, Object>> demoAccounts) Renders the login card for the requestedstep.
-
Method Details
-
login
Back-compat overload rendering the English defaults (used by unit tests). -
login
-
login
Back-compat overload: no demo accounts. -
login
public static Map<String,Object> login(AuthMethods methods, Palette p, UiMessages msg, String step, List<Map<String, Object>> demoAccounts) Renders the login card for the requestedstep.stepis only consulted when the picker is in play (both a password and SSO are offered);"password"shows the credentials step, anything else (includingnull) shows the picker.demoAccounts(each a{label, username, password}map) surfaces one-tap sign-in shortcuts on the password step; empty renders a plain form.
-