Stay organized with collections
Save and categorize content based on your preferences.
Firebase.AppCheck.FirebaseAppCheck
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
Public functions
|
GetAppCheckTokenAsync(bool forceRefresh)
|
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.
|
SetTokenAutoRefreshEnabled(bool isTokenAutoRefreshEnabled)
|
void
Sets the {.
|
Properties
Public static functions
SetAppCheckProviderFactory
void SetAppCheckProviderFactory(
IAppCheckProviderFactory factory
)
Installs the given IAppCheckProviderFactory, overwriting any that were previously associated with this FirebaseAppCheck instance.
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.
Public functions
GetAppCheckTokenAsync
System.Threading.Tasks.Task< AppCheckToken > GetAppCheckTokenAsync(
bool forceRefresh
)
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.
SetTokenAutoRefreshEnabled
void SetTokenAutoRefreshEnabled(
bool isTokenAutoRefreshEnabled
)
Sets the {.
isTokenAutoRefreshEnabled} flag.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-07 UTC.
[null,null,["Last updated 2024-08-07 UTC."],[],[],null,["Firebase.AppCheck.FirebaseAppCheck\n\n[Firebase](/docs/reference/unity/namespace/firebase#namespace_firebase) App Check object.\n\nSummary\n\nApp Check helps protect your API resources from abuse by preventing unauthorized clients from accessing your backend resources.\n\nWith App Check, devices running your app will use an AppCheckProvider that attests to one or both of the following:\n\n- Requests originate from your authentic app\n- Requests originate from an authentic, untampered device\n\n\u003cbr /\u003e\n\nProperties \n\nDefaultInstance \n\n```c#\nstatic FirebaseAppCheck DefaultInstance\n``` \nGets the instance of [FirebaseAppCheck](/docs/reference/unity/class/firebase/app-check/firebase-app-check#class_firebase_1_1_app_check_1_1_firebase_app_check) associated with the default [FirebaseApp](/docs/reference/unity/class/firebase/firebase-app#class_firebase_1_1_firebase_app) instance. \n\nTokenChanged \n\n```c#\nEventHandler\u003c TokenChangedEventArgs \u003e TokenChanged\n``` \n\nPublic static functions \n\nGetInstance \n\n```c#\nFirebaseAppCheck GetInstance(\n FirebaseApp app\n)\n``` \nGets the instance of [FirebaseAppCheck](/docs/reference/unity/class/firebase/app-check/firebase-app-check#class_firebase_1_1_app_check_1_1_firebase_app_check) associated with the given [FirebaseApp](/docs/reference/unity/class/firebase/firebase-app#class_firebase_1_1_firebase_app) instance. \n\nSetAppCheckProviderFactory \n\n```c#\nvoid SetAppCheckProviderFactory(\n IAppCheckProviderFactory factory\n)\n``` \nInstalls the given [IAppCheckProviderFactory](/docs/reference/unity/interface/firebase/app-check/i-app-check-provider-factory#interface_firebase_1_1_app_check_1_1_i_app_check_provider_factory), overwriting any that were previously associated with this [FirebaseAppCheck](/docs/reference/unity/class/firebase/app-check/firebase-app-check#class_firebase_1_1_app_check_1_1_firebase_app_check) instance.\n\nAutomatic token refreshing will only occur if the global isDataCollectionDefaultEnabled flag is set to true. To allow automatic token refreshing for [Firebase](/docs/reference/unity/namespace/firebase#namespace_firebase) App Check without changing the isDataCollectionDefaultEnabled flag for other [Firebase](/docs/reference/unity/namespace/firebase#namespace_firebase) SDKs, call [SetTokenAutoRefreshEnabled(bool)](/docs/reference/unity/class/firebase/app-check/firebase-app-check#class_firebase_1_1_app_check_1_1_firebase_app_check_1a5663ff8344b39567bc68e7d81f8cd93b) after installing the factory.\n\nThis method should be called before initializing the [Firebase](/docs/reference/unity/namespace/firebase#namespace_firebase) App.\n\nPublic functions \n\nGetAppCheckTokenAsync \n\n```c#\nSystem.Threading.Tasks.Task\u003c AppCheckToken \u003e GetAppCheckTokenAsync(\n bool forceRefresh\n)\n``` \nRequests a [Firebase](/docs/reference/unity/namespace/firebase#namespace_firebase) App Check token. This method should be used ONLY if you need to authorize requests to a non-Firebase backend. Requests to [Firebase](/docs/reference/unity/namespace/firebase#namespace_firebase) backends are authorized automatically if configured. \n\nSetTokenAutoRefreshEnabled \n\n```c#\nvoid SetTokenAutoRefreshEnabled(\n bool isTokenAutoRefreshEnabled\n)\n``` \nSets the {.\n\n\n```c#\nisTokenAutoRefreshEnabled} flag. \n```\n\n\u003cbr /\u003e"]]