RevokedJWT

This section covers the data structures and types used by the persisted database entity.

RevokedJWTEntity (Database Record)

revoked_jwt Database Table

FieldTypeDescription
idStringPrimary key of the database table.
expires_atDateTimeDefines the UTC expiration time of the revoked JWT. This value is used to determine when the revoked JWT record can be safely deleted.
token_idStringContains the identifier used internally by the Gateway to track and manage the JWT.
token_typeStringAllowed values: ACCESS, REFRESH, CONFIRM_USER, RESET_PWD, UPDATE_USERNAME, LOGIN_MFA, DELETE_USER_MFA

Delete the Expired Records

The following MySQL query deletes revoked JWT records that have expired. The query removes records where expires_at is earlier than or equal to the current UTC time. Expired revoked JWT records no longer need to be stored because the corresponding JWT cannot be used anymore. The LIMIT clause allows deletion to be performed in batches, avoiding large delete operations (recommended):

DELETE FROM revoked_jwt

WHERE expires_at <= UTC_TIMESTAMP()

LIMIT 1000;
📘

UTC_TIMESTAMP() is a MySQL function that returns the current UTC date and time in the MySQL DATETIME format, allowing it to be directly compared with DATETIME columns such as expires_at.




Did this page help you?