Get last login date on Edge for Private Cloud

Is there a way currently to know the last login date for a specific user?


Will this feature become available in the near future?

Solved Solved
0 1 410
1 ACCEPTED SOLUTION

There is currently no feature that provides the last login date directly. This is also not currently prioritised as a requirement.

The only way to do this is to enable the DEBUG logging levels on the UI logs. This would then log the authenticate api request. This api request will have the mail id that is authenticated - which will give an indication of when the login happened.

Note that it is not a recommended option to turn on DEBUG logs - unless you are debugging a problem - as this may potentially slow down the process of logging in and other UI features.

Another recommendation would be to use the log entry to get the information:

Whenever a user logs in, in the management server access logs, an entry is made which has the mail id of the user and also the POST authenticate and getexpiry api.

I am pasting an example below :

2017-10-10 06:18:06,132 pool-1-thread-1 INFO ACCESSLOG - AccessInfo.logAuditInfo() : \{User=opdk@apigee.com, Operation=POST, UserAgent=NING/1.0, ResponseCode=200, Request=''opdk@apige\
e.com'', RequestURI=/v1/users/opdk@apigee.com/authenticateAndGetExpiry, authenticationType=basic, Timestamp=1507616286129, ServerHostName=localhost, ServerIP=<ip>, RequestURIQP=/v1/users/opdk@apigee.com/authenticateAndGetExpiry, X-Forwarded-For=, ClientIP=<ip>\}

For every login, the above information is logged.
Notice the Request= and the RequestURI=

You could use this information to derive the last login for any user. You could also choose to develop a script that parses the logs and gives you the information of logins by a particular user.

View solution in original post

1 REPLY 1

There is currently no feature that provides the last login date directly. This is also not currently prioritised as a requirement.

The only way to do this is to enable the DEBUG logging levels on the UI logs. This would then log the authenticate api request. This api request will have the mail id that is authenticated - which will give an indication of when the login happened.

Note that it is not a recommended option to turn on DEBUG logs - unless you are debugging a problem - as this may potentially slow down the process of logging in and other UI features.

Another recommendation would be to use the log entry to get the information:

Whenever a user logs in, in the management server access logs, an entry is made which has the mail id of the user and also the POST authenticate and getexpiry api.

I am pasting an example below :

2017-10-10 06:18:06,132 pool-1-thread-1 INFO ACCESSLOG - AccessInfo.logAuditInfo() : \{User=opdk@apigee.com, Operation=POST, UserAgent=NING/1.0, ResponseCode=200, Request=''opdk@apige\
e.com'', RequestURI=/v1/users/opdk@apigee.com/authenticateAndGetExpiry, authenticationType=basic, Timestamp=1507616286129, ServerHostName=localhost, ServerIP=<ip>, RequestURIQP=/v1/users/opdk@apigee.com/authenticateAndGetExpiry, X-Forwarded-For=, ClientIP=<ip>\}

For every login, the above information is logged.
Notice the Request= and the RequestURI=

You could use this information to derive the last login for any user. You could also choose to develop a script that parses the logs and gives you the information of logins by a particular user.