Skip to main content

safety_net_config

Creates, updates, deletes, gets or lists a safety_net_config resource.

Overview

Namesafety_net_config
TypeResource
Idfirebase.appcheck.safety_net_config

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. The relative resource name of the SafetyNet configuration object, in the format: projects/{project_number}/apps/{app_id}/safetyNetConfig
tokenTtlstring (google-duration)Specifies the duration for which App Check tokens exchanged from SafetyNet tokens will be valid. If unset, a default value of 1 hour is assumed. Must be between 30 minutes and 7 days, inclusive.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, appsIdGets the SafetyNetConfig for the specified app.
batch_getselectprojectsIdnamesAtomically gets the SafetyNetConfigs for the specified list of apps.
patchupdateprojectsId, appsIdupdateMaskUpdates the SafetyNetConfig for the specified app. While this configuration is incomplete or invalid, the app will be unable to exchange SafetyNet tokens for App Check tokens.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
appsIdstring
projectsIdstring
namesstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets the SafetyNetConfig for the specified app.

SELECT
name,
tokenTtl
FROM firebase.appcheck.safety_net_config
WHERE projectsId = '{{ projectsId }}' -- required
AND appsId = '{{ appsId }}' -- required;

UPDATE examples

Updates the SafetyNetConfig for the specified app. While this configuration is incomplete or invalid, the app will be unable to exchange SafetyNet tokens for App Check tokens.

UPDATE firebase.appcheck.safety_net_config
SET
data__name = '{{ name }}',
data__tokenTtl = '{{ tokenTtl }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND appsId = '{{ appsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
tokenTtl;