firebase::app_check::AppCheck
#include <app_check.h>
Firebase App Check object.
Summary
App Check helps protect your API resources from abuse by preventing unauthorized clients from accessing your backend resources.
With App Check, devices running your app will use an AppCheckProvider that attests to one or both of the following:
- Requests originate from your authentic app
- Requests originate from an authentic, untampered device
Constructors and Destructors |
|
---|---|
~AppCheck()
Destructor.
|
Public functions |
|
---|---|
AddAppCheckListener(AppCheckListener *listener)
|
void
Registers an AppCheckListener to changes in the token state.
|
GetAppCheckToken(bool force_refresh)
|
Requests a Firebase App Check token.
|
GetAppCheckTokenLastResult()
|
Returns the result of the most recent call to GetAppCheckToken();.
|
RemoveAppCheckListener(AppCheckListener *listener)
|
void
Unregisters an AppCheckListener to changes in the token state.
|
SetTokenAutoRefreshEnabled(bool is_token_auto_refresh_enabled)
|
void
Sets the isTokenAutoRefreshEnabled flag.
|
app()
|
::firebase::App *
Get the firebase::App that this AppCheck was created with.
|
Public static functions |
|
---|---|
GetInstance(::firebase::App *app)
|
AppCheck *
|
SetAppCheckProviderFactory(AppCheckProviderFactory *factory)
|
void
Installs the given AppCheckProviderFactory, overwriting any that were previously associated with this AppCheck instance.
|
Public functions
AddAppCheckListener
void AddAppCheckListener( AppCheckListener *listener )
Registers an AppCheckListener to changes in the token state.
This method should be used ONLY if you need to authorize requests to a non-Firebase backend. Requests to Firebase backends are authorized automatically if configured.
GetAppCheckToken
Future< AppCheckToken > GetAppCheckToken( bool force_refresh )
Requests a Firebase App Check token.
This method should be used ONLY if you need to authorize requests to a non-Firebase backend. Requests to Firebase backends are authorized automatically if configured.
GetAppCheckTokenLastResult
Future< AppCheckToken > GetAppCheckTokenLastResult()
Returns the result of the most recent call to GetAppCheckToken();.
RemoveAppCheckListener
void RemoveAppCheckListener( AppCheckListener *listener )
Unregisters an AppCheckListener to changes in the token state.
SetTokenAutoRefreshEnabled
void SetTokenAutoRefreshEnabled( bool is_token_auto_refresh_enabled )
Sets the isTokenAutoRefreshEnabled flag.
app
::firebase::App * app()
Get the firebase::App that this AppCheck was created with.
Details | |
---|---|
Returns |
The firebase::App this AppCheck was created with.
|
~AppCheck
~AppCheck()
Public static functions
GetInstance
AppCheck * GetInstance( ::firebase::App *app )
SetAppCheckProviderFactory
void SetAppCheckProviderFactory( AppCheckProviderFactory *factory )
Installs the given AppCheckProviderFactory, overwriting any that were previously associated with this AppCheck instance.
Any AppCheckTokenListeners attached to this AppCheck instance will be transferred from existing factories to the newly installed one.
Automatic token refreshing will only occur if the global isDataCollectionDefaultEnabled flag is set to true. To allow automatic token refreshing for Firebase App Check without changing the isDataCollectionDefaultEnabled flag for other Firebase SDKs, call setTokenAutoRefreshEnabled(bool) after installing the factory.
This method should be called before initializing the Firebase App.