Firebase Authentication Extension
Simple Firebase Auth is a compact Firebase Authentication extension for MIT App Inventor and Niotron, providing Firebase Authentication through Google's Identity Toolkit REST API, along with classic Google Sign-In.
The extension is designed around a simple success/failure event system, so multiple authentication operations can be handled using a small and clean blocks surface.
Features
Email & Password
-
Sign in with email and password
-
Create a new Firebase account
-
Local failed-login protection with configurable lockout
Anonymous Authentication
-
Sign in anonymously
-
Useful for guest users and temporary accounts
Google Sign-In
-
Opens the Google account picker
-
Supports Firebase Web Client ID
-
Automatically exchanges the Google ID token with Firebase
-
Returns the Firebase authentication result through the same
AuthSuccess/AuthFailedsystem
Automatic Token Refresh
Firebase ID tokens normally expire after one hour. Simple Firebase Auth can automatically refresh the token before expiration when auto-refresh is enabled.
Auto-refresh is enabled by default after a successful authentication.
Persistent Sessions
The extension stores the authentication session locally and provides:
-
TryAutoLogin() -
IsSignedIn -
CurrentUserId -
CurrentEmail -
CurrentIdToken
TryAutoLogin() can restore a fresh stored session immediately or refresh an expired ID token when a refresh token is available.
Password & Email Management
Through ManageAccount():
-
Send password reset email
-
Send email verification
-
Change password
-
Update display name
-
Update profile photo URL
-
Fetch fresh user information
-
Delete the Firebase account
Login Attempt Protection
SignInWithEmail() includes a configurable local brute-force guard.
You can configure:
-
Maximum failed attempts
-
Base lockout duration
-
Automatic token refresh
The lockout duration increases with repeated lockout streaks and is capped by the implementation. This is a client-side convenience/protection layer, while Firebase's own authentication protection remains the actual security boundary.
Clean Authentication Events
Instead of having separate success/failure events for every authentication operation, the extension uses two primary events:
AuthSuccess
Returns:
-
action -
uid -
email -
idToken
AuthFailed
Returns:
-
action -
reasonCode -
message -
isRetryable
This allows the same event blocks to handle sign-in, sign-up, Google Sign-In, auto-login, token refresh and account-management operations.
Stable Error Codes
AuthFailed provides documented reason codes so you don't have to depend on Firebase's raw error strings.
Examples include:
-
WRONG_CREDENTIALS -
USER_NOT_FOUND -
ACCOUNT_DISABLED -
EMAIL_ALREADY_IN_USE -
WEAK_PASSWORD -
INVALID_EMAIL -
TOO_MANY_ATTEMPTS -
NO_SESSION -
REAUTH_REQUIRED -
SESSION_EXPIRED -
NETWORK_ERROR -
CANCELLED -
NO_ID_TOKEN -
NOT_FOUND -
UNKNOWN_ACTION -
UNKNOWN
Main Functions
-
SetApiKey() -
Configure() -
TryAutoLogin() -
RefreshIdToken() -
SignOut() -
SignInWithEmail() -
CreateUserWithEmail() -
SignInAnonymously() -
SignInWithGoogle() -
SignOutGoogle() -
ManageAccount()
Properties
-
IsSignedIn -
CurrentUserId -
CurrentEmail -
CurrentIdToken -
CurrentDisplayName -
CurrentPhotoUrl -
CurrentEmailVerified -
IsLockedOut -
SecondsUntilUnlocked
Additional Events
-
GoogleIdTokenReceived -
UserInfoReceived -
LockedOut
REST-Based Firebase Authentication
For Firebase authentication operations, the extension communicates directly with Google's Identity Toolkit REST endpoints using HttpURLConnection, instead of relying on the native FirebaseAuth SDK.
Google authentication uses Google's classic GoogleSignInClient / GoogleSignInOptions API.
Designed For
MIT App Inventor • Niotron • Android Apps
Built with Java + Fast CLI. ![]()
Download
Simple Firebase Auth Extension:
simpleAuth.aix (1.5 MB)
