Function Signature
Description
The entry point for Client Auth.PortalAuth() always returns the same instance, backed by a single native PortalAuth. Call configure once at startup, then start a sign-in, complete it from the redirect, and pass the resulting PortalSession to Portal().initialize(session:).
PortalAuth never opens a browser and never listens for deep links: your app opens the authorize URL and passes every incoming link to handleRedirect.
Available starting from portal_flutter 2.0.0.
Methods
Types
PortalSession
A signed-in session, passed toPortal().initialize(session:). The session token stays on the native side; this is only a handle to it, valid for the lifetime of the app process. Apps never construct one.
PortalAuthResult
A sealed class returned byhandleRedirect, with two cases.
PortalAuthenticated — the sign-in completed, and the session is already persisted on the device.
PortalTotpRequired — the environment requires a TOTP code before it issues a session. Complete it with verifyTotp.
PortalAuthMethods
Returned bygetMethods.
PortalAuthMethod
An enum:emailMagicLink, google, apple.
PortalAuthorizeUrl
Returned byloginWithGoogle and loginWithApple.
PortalMagicLinkConfig
Passed toconfigure as magicLink.
Example
Errors
EveryPortalAuth method throws a PortalException with an AUTH_* code. See Handle errors for the full list.