How can we implement the login tracking on camunda 7.18

we have a requirement where we need to store last logged details of user in a db

example :-1:
user 1 logged into X time on camunda tasklist
user 2 logged into Y time on camunda tasklist

application should store the details as below
1 User1 X
2 User2. Y

Note:- i am good in creating api or service class and storing the data but what i would need from here is how can i catch the data of logged in person