Skip to main content

debug_tokens

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

Overview

Namedebug_tokens
TypeResource
Idfirebase.appcheck.debug_tokens

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. The relative resource name of the debug token, in the format: projects/{project_number}/apps/{app_id}/debugTokens/{debug_token_id}
displayNamestringRequired. A human readable display name used to identify this debug token.
tokenstringRequired. Input only. Immutable. The secret token itself. Must be provided during creation, and must be a UUID4, case insensitive. This field is immutable once set, and cannot be provided during an UpdateDebugToken request. You can, however, delete this debug token using DeleteDebugToken to revoke it. For security reasons, this field will never be populated in any response.
updateTimestring (google-datetime)Output only. Timestamp when this debug token was most recently updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, appsId, debugTokensIdGets the specified DebugToken. For security reasons, the token field is never populated in the response.
listselectprojectsId, appsIdpageSize, pageTokenLists all DebugTokens for the specified app. For security reasons, the token field is never populated in the response.
createinsertprojectsId, appsIdCreates a new DebugToken for the specified app. For security reasons, after the creation operation completes, the token field cannot be updated or retrieved, but you can revoke the debug token using DeleteDebugToken. Each app can have a maximum of 20 debug tokens.
patchupdateprojectsId, appsId, debugTokensIdupdateMaskUpdates the specified DebugToken. For security reasons, the token field cannot be updated, nor will it be populated in the response, but you can revoke the debug token using DeleteDebugToken.
deletedeleteprojectsId, appsId, debugTokensIdDeletes the specified DebugToken. A deleted debug token cannot be used to exchange for an App Check token. Use this method when you suspect the secret token has been compromised or when you no longer need the debug token.

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
debugTokensIdstring
projectsIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets the specified DebugToken. For security reasons, the token field is never populated in the response.

SELECT
name,
displayName,
token,
updateTime
FROM firebase.appcheck.debug_tokens
WHERE projectsId = '{{ projectsId }}' -- required
AND appsId = '{{ appsId }}' -- required
AND debugTokensId = '{{ debugTokensId }}' -- required;

INSERT examples

Creates a new DebugToken for the specified app. For security reasons, after the creation operation completes, the token field cannot be updated or retrieved, but you can revoke the debug token using DeleteDebugToken. Each app can have a maximum of 20 debug tokens.

INSERT INTO firebase.appcheck.debug_tokens (
data__name,
data__displayName,
data__token,
projectsId,
appsId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ token }}',
'{{ projectsId }}',
'{{ appsId }}'
RETURNING
name,
displayName,
token,
updateTime
;

UPDATE examples

Updates the specified DebugToken. For security reasons, the token field cannot be updated, nor will it be populated in the response, but you can revoke the debug token using DeleteDebugToken.

UPDATE firebase.appcheck.debug_tokens
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__token = '{{ token }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND appsId = '{{ appsId }}' --required
AND debugTokensId = '{{ debugTokensId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
displayName,
token,
updateTime;

DELETE examples

Deletes the specified DebugToken. A deleted debug token cannot be used to exchange for an App Check token. Use this method when you suspect the secret token has been compromised or when you no longer need the debug token.

DELETE FROM firebase.appcheck.debug_tokens
WHERE projectsId = '{{ projectsId }}' --required
AND appsId = '{{ appsId }}' --required
AND debugTokensId = '{{ debugTokensId }}' --required;