Skip to main content

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 to Portal().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 by handleRedirect, 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 by getMethods.

PortalAuthMethod

An enum: emailMagicLink, google, apple.

PortalAuthorizeUrl

Returned by loginWithGoogle and loginWithApple.

PortalMagicLinkConfig

Passed to configure as magicLink.

Example

Errors

Every PortalAuth method throws a PortalException with an AUTH_* code. See Handle errors for the full list.