The Firebase App class that handles the authentication/authorization task.
class FirebaseApp
Get the app initialization status.
bool isInitialized() const
Returns:
bool
- Return true if initialized.
The authentication/authorization handler.
void loop()
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() const
Returns:
String
- String of auth tokens based on the authentication/authoeization e.g. ID token and access token.
Get the refresh token.
String getRefreshToken() const
Returns:
String
- String of refresh token after user sign in or authorization using ID token.
Get unique identifier.
String getUid() const
Returns:
String
- String of unique identifier after user sign in or authorization using ID token.
Get the authentication status since app initialized.
bool isAuthenticated() const
Returns:
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 JWT token processor object.
This function should be executed before calling initializeApp
.
void setJWTProcessor(JWTClass &jwtClass)
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.
Reset or clear app (deinitailize).
void deinitializeApp()