You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to retrieve user last Login timestamp and display in UI. For this, we are getting the last login timestamp from user claims. However, after user logs in to their account the timestamp gets updated and the token generated after login returns the current login time.
We need the last login timestamp and not the current one.
Is this the expected behavior?
If yes, how do we achieve the last one and not the current one (Is there different claim for it?).
If no, what did we miss?
The text was updated successfully, but these errors were encountered:
Hi,
I am facing the same issue. lastlogin timestamp return the current login timestamp value.And i have observe that last login timestamp value is return when we have added below last login custom component jar file in the dropin folder of wso2 identity server"org.wso2.carbon.custom.user.operation.event.listener-1.0.0.jar" If we remove this file from dropin folder then last login timestamp value is not return.In this jar code I have found that lastlogin timestamp logic is return in the doPostAuthenticate method which is as below:
long lastLoginTimestamp = System.currentTimeMillis();
Map<String, String> claimMap = new HashMap<String, String>();
claimMap.put(LAST_LOGIN_TIMESTAMP_CLAIM, Long.toString(lastLoginTimestamp));
In this logic we have saved the current system time in the lastLoginTimestamp variable. so it is return the current login timestamp.which should not be the lastLoginTimestamp because lastLoginTimestamp should be displayed as previous login time of user.
So let me know is it required to add org.wso2.carbon.custom.user.operation.event.listener-1.0.0.jar in wso2 dropin folder to retrieve the Lastlogin timestamp.This jar code is written in 2015 can you provide me the latest code for this jar.
We are trying to retrieve user last Login timestamp and display in UI. For this, we are getting the last login timestamp from user claims. However, after user logs in to their account the timestamp gets updated and the token generated after login returns the current login time.
We need the last login timestamp and not the current one.
Is this the expected behavior?
If yes, how do we achieve the last one and not the current one (Is there different claim for it?).
If no, what did we miss?
The text was updated successfully, but these errors were encountered: