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
secretand installs the session. A failed attempt means "not redeemed yet", so both rejections and transport blips keep the wait alive untiltimeoutor untilcancelcompletes. -
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 inauth.roles), carrying their access token viajwtor the constructor'sjwtProvider. -
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.deletewith their access token;delete: selflets a user close their own account. -
dispose(
) → void -
exchangeOAuthCode(
String code) → Future< AuthSession> -
Redeems the
aq_codeof 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.
redirectTomust be an allowed origin of the project — a custom scheme counts — and comes back carryingaq_codeoraq_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.
signInWithOAuthdoes 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.updatewith their access token;roleis bounded byauth.roles.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited