[31:14] (extern: com.lehman.aussomserver.connectors.AussomFirebase) extends: object
The firebase class provides Firebase Authentication functionality for verifying OAuth2 tokens, managing users, and generating email action links. It wraps the Google Firebase Admin Java SDK. Initialize with a Firebase service account JSON string: fb = new firebase(file.read("app_data/service-account.json")); Verify an ID token (core OAuth2 flow): token = fb.verifyIdToken(idTokenString); uid = token.uid;
firebase (string ServiceAccountJson)
Creates a new firebase authentication object initialized with the provided service account JSON string.
ServiceAccountJson is a string with the Firebase service account JSON credentials.this object_init (string ServiceAccountJson)
verifyIdToken (string IdToken, bool CheckRevoked = false)
Verifies a Firebase ID token string and returns a map with the decoded token data including uid, email, name, emailVerified, issuer, picture, and claims.
IdToken is a string with the Firebase ID token.CheckRevoked is an optional bool to check if the token has been revoked. (default: false)A map with the decoded token data.createSessionCookie (string IdToken, int ExpiresInMs)
Creates a session cookie from an ID token. The cookie can be verified later with verifySessionCookie().
IdToken is a string with the Firebase ID token.ExpiresInMs is an int with the cookie expiration time in milliseconds (min 5 minutes, max 14 days).A string with the session cookie.verifySessionCookie (string Cookie, bool CheckRevoked = false)
Verifies a session cookie and returns the decoded token data.
Cookie is a string with the session cookie.CheckRevoked is an optional bool to check if the session has been revoked. (default: false)A map with the decoded token data.createCustomToken (string Uid, map Claims)
Creates a custom token for the given UID. Custom tokens can be used by client SDKs to sign in.
Uid is a string with the user UID.Claims is an optional map with custom claims to include.A string with the custom token.getUser (string Uid)
Gets a user record by UID.
Uid is a string with the user UID.A map with the user record data.getUserByEmail (string Email)
Gets a user record by email address.
Email is a string with the email address.A map with the user record data.getUserByPhone (string PhoneNumber)
Gets a user record by phone number.
PhoneNumber is a string with the phone number in E.164 format (e.g., "+15555551234").A map with the user record data.createUser (map Options)
Creates a new user with the provided options map. Supported keys: email, password, displayName, phoneNumber, photoUrl, emailVerified (bool), disabled (bool).
Options is a map with the user properties to set.A map with the created user record data.updateUser (string Uid, map Options)
Updates an existing user with the provided options map. Supported keys: email, password, displayName, phoneNumber, photoUrl, emailVerified (bool), disabled (bool).
Uid is a string with the user UID to update.Options is a map with the user properties to update.A map with the updated user record data.deleteUser (string Uid)
Deletes a user by UID.
Uid is a string with the user UID to delete.nullsetCustomClaims (string Uid, map Claims)
Sets custom claims on a user. These claims are included in ID tokens and can be used for role-based access control. Pass an empty map to clear all custom claims.
Uid is a string with the user UID.Claims is a map with the custom claims to set.nullrevokeRefreshTokens (string Uid)
Revokes all refresh tokens for a user, forcing them to re-authenticate on all devices.
Uid is a string with the user UID.nulllistUsers (string PageToken = "", int MaxResults = 1000)
Lists users with pagination support.
PageToken is an optional string with the page token from a previous listUsers call. Pass empty string for first page.MaxResults is an optional int with the max number of users to return per page. (default: 1000)A map with 'users' (list of user maps) and 'nextPageToken' (string, empty if no more pages).generatePasswordResetLink (string Email)
Generates a password reset email link for the given email.
Email is a string with the user's email address.A string with the password reset link.generateEmailVerificationLink (string Email)
Generates an email verification link for the given email.
Email is a string with the user's email address.A string with the email verification link.generateSignInWithEmailLink (string Email, map ActionCodeSettings)
Generates a sign-in with email link.
Email is a string with the user's email address.ActionCodeSettings is a map with settings. Required key: 'url' (string, the continue URL). Optional keys: 'handleCodeInApp' (bool).A string with the sign-in link.