# firebase::app_check::AppCheckProvider


**This is an abstract class.**


`#include <app_check.h>`

Interface for a provider that generates [AppCheckToken](https://firebase.google.com/docs/reference/cpp/struct/firebase/app-check/app-check-token#structfirebase_1_1app__check_1_1_app_check_token)s.

## Summary

This provider can be called at any time by any Firebase library that depends (optionally or otherwise) on [AppCheckToken](https://firebase.google.com/docs/reference/cpp/struct/firebase/app-check/app-check-token#structfirebase_1_1app__check_1_1_app_check_token)s. This provider is responsible for determining if it can create a new token at the time of the call and returning that new token if it can.

| ### Constructors and Destructors ||
|---|---|
| `https://firebase.google.com/docs/reference/cpp/class/firebase/app-check/app-check-provider#classfirebase_1_1app__check_1_1_app_check_provider_1a88ddf70313c8de8fa8b137a3593504bc()` ||

| ### Public functions ||
|---|---|
| `https://firebase.google.com/docs/reference/cpp/class/firebase/app-check/app-check-provider#classfirebase_1_1app__check_1_1_app_check_provider_1a037c6ef44aaf8e98b48d0d1e46f7d44b(std::function< void(https://firebase.google.com/docs/reference/cpp/struct/firebase/app-check/app-check-token#structfirebase_1_1app__check_1_1_app_check_token, int, const std::string &)> completion_callback)` | `virtual void` Fetches an [AppCheckToken](https://firebase.google.com/docs/reference/cpp/struct/firebase/app-check/app-check-token#structfirebase_1_1app__check_1_1_app_check_token) suitable for consumption in limited-use scenarios and then calls the provided callback function with the token or with an error code and error message. |
| `https://firebase.google.com/docs/reference/cpp/class/firebase/app-check/app-check-provider#classfirebase_1_1app__check_1_1_app_check_provider_1a1bfe8c92a50c664c35063f14c31a5647(std::function< void(https://firebase.google.com/docs/reference/cpp/struct/firebase/app-check/app-check-token#structfirebase_1_1app__check_1_1_app_check_token, int, const std::string &)> completion_callback)=0` | `virtual void` Fetches an [AppCheckToken](https://firebase.google.com/docs/reference/cpp/struct/firebase/app-check/app-check-token#structfirebase_1_1app__check_1_1_app_check_token) and then calls the provided callback method with the token or with an error code and error message. |

## Public functions

### GetLimitedUseToken

```c++
virtual void GetLimitedUseToken(
  std::function< void(AppCheckToken, int, const std::string &)> completion_callback
)
```
Fetches an [AppCheckToken](https://firebase.google.com/docs/reference/cpp/struct/firebase/app-check/app-check-token#structfirebase_1_1app__check_1_1_app_check_token) suitable for consumption in limited-use scenarios and then calls the provided callback function with the token or with an error code and error message.

If you do not implement this method, the default implementation invokes the GetToken method whenever a limited-use token is requested.

### GetToken

```c++
virtual void GetToken(
  std::function< void(AppCheckToken, int, const std::string &)> completion_callback
)=0
```
Fetches an [AppCheckToken](https://firebase.google.com/docs/reference/cpp/struct/firebase/app-check/app-check-token#structfirebase_1_1app__check_1_1_app_check_token) and then calls the provided callback method with the token or with an error code and error message.

### \~AppCheckProvider

```c++
virtual  ~AppCheckProvider()=0
```