The Firebase App class that handles the authentication/authorization task.
class FirebaseAppGet the app initialization status.
bool isInitialized() constReturns:
bool- Return true if initialized.
The authentication and async tasks handler.
Since v2.0.0, the async task in any AsyncClient's queue that belongs to this app will be maintained to run which includes the tasks in the AsyncClient's queue that was assigned to the initializeApp function.
Then calling individual Firebase service's class's loop is not neccessary and can be ignored.
void loop(JWTClass *jwt = nullptr)Params:
jwt- Optional. The pointer toJWTClassclass object to handle the JWT token generation and signing.
Get the authentication/autorization process status.
bool ready()Returns:
bool- Return true if the auth process was finished. Returns false ifisExpired()returns true.
Appy the authentication/authorization credentials to the Firebase services app.
void getApp(T &app)Params:
app- The Firebase services calss object e.g. RealtimeDatabase, Storage, Messaging, CloudStorage and CloudFunctions.
Get the auth token.
String getToken() constReturns:
String- String of auth tokens based on the authentication/authoeization e.g. ID token and access token.
Get the token type.
firebase_token_type getTokenType()Returns:
firebase_token_typeenums - The enums are included following:token_type_id(3),token_type_access(2),token_type_legacy(1) andtoken_type_no(0).
Get the refresh token.
String getRefreshToken() constReturns:
String- String of refresh token after user sign in or authorization using ID token.
Get unique identifier.
String getUid() constReturns:
String- String of unique identifier after user sign in or authorization using ID token.
Get the authentication status since app initialized.
bool isAuthenticated() constReturns:
bool- Return true once authenticated since initialized. It will reset when app re-initialized and user management task was executed.
Get the auth token expiration status.
bool isExpired()Returns:
bool- Return true if auth token was expired upon the expire period setup.
Get the remaining time to live of token until expired.
unsigned long ttl()Params:
unsigned long- The integer value of ttl.
Set the async result callback function.
void setCallback(AsyncResultCallback cb)Params:
cb- The async result callback function (AsyncResultCallback).
Set the async result class object.
void setAsyncResult(AsyncResult &aResult)Params:
aResult- The async result (AsyncResult).
Set the UID for authentication task.
The UID will be applied when used with the async result callback only.
The async result object set via initializeApp and FirebaseApp::setAsyncResult will not take effect.
void setUID(const String &uid)Params:
uid- The unique identifier for the authentication task.
Set the app UNIX timestamp.
void setTime(uint32_t sec)Params:
sec- The UNIX timestamp in seconds.
Params:
jwtClass- The JWT token processor object.
Get the pointer to the internal auth data.
auth_data_t *getAuth()Returns:
auth_data_t*- The pointer to internal auth data.
Set the option to enable/disable re-authentication.
void autoAuthenticate(bool enable)Params:
enable- Set to true to enable or false to disable.
Force library to re-authenticate (refresh the auth token).
void authenticate()Set the JWT token processor object (DEPRECATED).
This function should be executed before calling initializeApp.
Use FirebaseApp::loop function instead for assigning the JWT token processor for individual app (thread safe).
void setJWTProcessor(JWTClass &jwtClass)Params:
jwtClass- The pointer to JWTClass class object to handle the JWT token generation and signing.