AquabaseAuth class

Available extensions

Constructors

AquabaseAuth({String serverUrl = aquabaseDefaultServerUrl, required String apiKey, Future<void> onSession(AuthSession session)?, String? jwtProvider()?})

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

awaitOAuthPairing(String secret, {Duration timeout = const Duration(minutes: 5), Future<void>? cancel}) → Future<AuthSession>
Waits for the browser side of secret and installs the session. A failed attempt means "not redeemed yet", so both rejections and transport blips keep the wait alive until timeout or until cancel completes.
createUser(String email, String password, {String? role, String? jwt}) → Future<String>
Create an account without issuing a session: no tokens are minted, no refresh session is left on the server, nothing is installed locally. Returns the new user's uid. Same API-key gate as register. With role, the caller must be a delegated admin of the project rules (auth.create + the role in auth.roles), carrying their access token via jwt or the constructor's jwtProvider.
deleteUser(String uid, {String? jwt}) → Future<void>
Delete a user's account: record, email index and sealed E2E identity. Caller needs the secret key or auth.delete with their access token; delete: self lets a user close their own account.
dispose() → void
exchangeOAuthCode(String code) → Future<AuthSession>
Redeems the aq_code of a return link and installs the session.
login(String email, String password) → Future<AuthSession>
Login an existing user and install the session on this instance.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
oauthUrl(OAuthProvider provider, String redirectTo) → Uri
Hosted flow returning to a link of your own instead of pairing. redirectTo must be an allowed origin of the project — a custom scheme counts — and comes back carrying aq_code or aq_error.
refresh(String refreshToken) → Future<AuthSession>
Rotate a session using its refresh token. Does not install the result.
register(String email, String password) → Future<AuthSession>
Register a new end-user and install the session on this instance.
signInWithGoogleNative() → Future<AuthSession?>

Available on AquabaseAuth, provided by the AquabaseGoogleNative extension

Sign in with Google through the system sheet — Credential Manager on Android, the Google SDK on iOS/macOS — which lists the accounts already on the device, so nothing ever leaves the app into a browser tab.
signInWithIdToken(OAuthProvider provider, String credential) → Future<AuthSession>
Sign in with a credential the app already holds.
signInWithOAuth(BuildContext context, OAuthProvider provider, {Duration timeout = const Duration(minutes: 5)}) → Future<AuthSession?>

Available on AquabaseAuth, provided by the AquabaseOAuthUi extension

Sign in with an OAuth provider and install the session.
startOAuthPairing(OAuthProvider provider) → Future<OAuthPairing>
Pairing for callers driving the browser themselves: open OAuthPairing.url and hand its secret to awaitOAuthPairing. signInWithOAuth does both.
toString() → String
A string representation of this object.
inherited
updateUser(String uid, {bool? disabled, String? role, String? email, String? password, String? jwt}) → Future<void>
Update a user: disable/enable, change role, email or password. The caller must hold the project secret key or satisfy auth.update with their access token; role is bounded by auth.roles.

Operators

operator ==(Object other) → bool
The equality operator.
inherited