firebase_admin.app_check module

Firebase App Check module.

Functions

verify_token

firebase_admin.app_check.verify_token(token: str, app=None, consume: bool = False) Dict[str, Any]

Verifies a Firebase App Check token, optionally consuming limited-use tokens.

Parameters:
  • token – A token from App Check.

  • app – An App instance (optional).

  • consume – Set to True only if the token is a limited-use (one-time) token that should be consumed upon verification (optional, defaults to False).

Returns:

The token’s decoded claims. If consume is True, the dictionary

also includes an already_consumed boolean key indicating whether the token was previously consumed.

Return type:

Dict[str, Any]

Raises:
  • ValueError – If consume is not a boolean, or if the app’s project_id is invalid or unspecified, or if the token’s headers or payload are invalid.

  • FirebaseError – If an error occurs while communicating with the App Check service.

  • PyJWKClientError – If PyJWKClient fails to fetch a valid signing key.