Find out last password modified timestamp of an user in Cassandra DB

36 Views Asked by At

I am a student, and I am trying to find the details on how to get the last password modified date and time for a user in cql. Please help me with the query to find out the last password modified date and time of the user1 ID in Cassandra DB.

Thanks, Tina

1

There are 1 best solutions below

0
Aaron On

Sure, you can use the writetime() function on the salted_hash column on the system_auth.roles table:

> SELECT role,writetime(salted_hash)
  FROm roles WHERE role='aaron';

 role  | writetime(salted_hash)
-------+------------------------
 aaron |       1698686437684000

(1 rows)

When this writetime is converted to a date/time, I can see that I changed my password on Monday, October 30, 2023 at 12:20:37.684 PM GMT-05:00.