Skip to main content

tokens

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

Overview

Nametokens
TypeResource
Idaws.amplifybackend.tokens

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
app_idstringThe app ID.
challenge_codestringThe one-time challenge code for authenticating into the Amplify Admin UI.
session_idstringA unique ID provided when creating a new challenge token.
ttlstringThe expiry time for the one-time generated token code.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_tokenselectapp_id, session_id, regionGets the challenge token based on the given appId and sessionId.
create_tokeninsertapp_id, regionGenerates a one-time challenge code to authenticate a user into your Amplify Admin UI.
delete_tokendeleteapp_id, session_id, regionDeletes the challenge token based on the given appId and sessionId.

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
app_idstringThe app ID.
regionstringAWS region (default: us-east-1)
session_idstringThe session ID.

SELECT examples

Gets the challenge token based on the given appId and sessionId.

SELECT
app_id,
challenge_code,
session_id,
ttl
FROM aws.amplifybackend.tokens
WHERE app_id = '{{ app_id }}' -- required
AND session_id = '{{ session_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Generates a one-time challenge code to authenticate a user into your Amplify Admin UI.

INSERT INTO aws.amplifybackend.tokens (
app_id,
region
)
SELECT
'{{ app_id }}',
'{{ region }}'
RETURNING
app_id,
challenge_code,
session_id,
ttl
;

DELETE examples

Deletes the challenge token based on the given appId and sessionId.

DELETE FROM aws.amplifybackend.tokens
WHERE app_id = '{{ app_id }}' --required
AND session_id = '{{ session_id }}' --required
AND region = '{{ region }}' --required
;