ab_ecosystem_sso 0.1.0
ab_ecosystem_sso: ^0.1.0 copied to clipboard
Flutter SDK for AB Ecosystem SSO — drop-in sign-in and sign-up widgets, 2FA, multi-account switching, captcha and secure session storage.
Changelog #
0.1.0 #
First release.
Authentication, account settings, team administration and billing for Flutter
apps against AB Ecosystem SSO, ported from the ab-ecosystem-sso web SDK.
Added #
SsoClient— sign-in, 2FA verification, signup, forgot-password, reset-password, verify-email, change-password and logout, plusGET /meprofile and account-context reads.- Sealed
LoginResultcovering the three login outcomes (signed in, 2FA required, account selection required) andSignupResultcovering the two signup outcomes, so every branch is handled at compile time. - Multi-account support:
selectAccount,switchAccount,listAccounts, and invitation lookup and acceptance. - Session state as a
ValueListenable<SsoSession>, withA403reported asSsoAccountAccessLostrather than a sign-out. SsoScope, which provides the client and re-checks the session when the app returns to the foreground.- Widgets:
SsoAuthFlow,SsoLoginForm,SsoSignupForm,SsoTwoFactorForm,SsoForgotPasswordFormandSsoAccountPicker, themed fromTheme.of(context)and translatable throughSsoStrings. - Captcha support via
WebViewCaptchaSolver, which builds the provider's page from the site key inGET /auth-configand needs nothing deployed, withWebViewCaptchaSolver.hostedfor a page you serve yourself and aCaptchaSolverinterface for your own implementation. - Token persistence in the platform keychain or keystore (
SecureTokenStore), with an in-memory fallback so storage failures never crash the app, plusMemoryTokenStoreto opt out. AuthHttpClientfor attaching the session token to your own API calls, with a mandatory origin allowlist and 401 /A403dispatch.jwtExpiryandisJwtExpired, used to discard an already-expired token without a round trip.- Account settings:
SsoAccountSettings(andshowSsoAccountSettings) with nine panes that hide themselves when they don't apply, plus each pane standalone —SsoProfileForm,SsoChangePasswordForm,SsoTwoFactorSetup,SsoWhatsAppSetup,SsoWalletSection,SsoPlansSection,SsoCreditsSection,SsoMembersSection,SsoRolesSectionandSsoInvitationsSection, andSsoLogoutButton. Copy lives inSsoSettingsStrings. - Profile editing (
PUT /profile) withProfileUpdate, which can be seeded from a profile so a one-field edit doesn't blank the rest. - 2FA enrolment —
beginTwoFactor,confirmTwoFactor,disableTwoFactor,twoFactorEnabled— against both backend endpoint families, which stay reachable from one client:SsoConfig.twoFactorFamilysets the default and every call (andSsoTwoFactorSetup) takes afamilyof its own. - WhatsApp as a second factor:
whatsAppStatus,enableWhatsApp,verifyWhatsApp, withsplitDialCodefor the dial-code the verify endpoint wants separately. - Team administration: the permission catalogue (
permissions, cached) withexpandPermissionsandindexActions, roles CRUD, memberships with three-statePatchupdates, the member-sideteamlist, and invitations.SsoPermissionMatrixandSsoDataScopeControlrender the editor, showing implied permissions ticked and locked. - Billing:
plans,subscribe,subscription,wallets,walletLogs,rechargeLinks,creditWallets,creditWalletLogsandrechargeCreditWallet, with mapping for both wallet-log wire shapes.
Known limits #
Email links are not received or parsed (the endpoints are there once you hold a
token), external URLs need an onLaunchUrl callback, plan descriptions are
shown as written rather than rendered as markdown, and dates and amounts are
formatted without intl. See the README.