RevokedJWT
This section covers the data structures and types used by the persisted database entity.
RevokedJWTEntity (Database Record)
revoked_jwt Database Table
| Field | Type | Description |
|---|---|---|
| id | String | Primary key of the database table. |
| expires_at | DateTime | Defines the UTC expiration time of the revoked JWT. This value is used to determine when the revoked JWT record can be safely deleted. |
| token_id | String | Contains the identifier used internally by the Gateway to track and manage the JWT. |
| token_type | String | Allowed 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 MySQLDATETIMEformat, allowing it to be directly compared withDATETIMEcolumns such asexpires_at.
Updated about 1 month ago
Did this page help you?