SSO and last login

Earl L
Mega Guru

We have a SAML/SSO configuration that is working great for us. However, I noticed that the last login time isn't getting set for user accounts, where users are actively logging into the system (my account included). I dug up the "last login time" script that's in our instance (under System properties > Script actions) but for probably obvious reasons it's not recording last login time. It is set to fire on the login event.

So I suppose there are two (or more?) possibilities here:
1) the login event isn't being fired because we've enabled the SSO? (possibly)
2) the script isn't written correctly to actually record the last login time? (doubtful)

I also tried taking the appropriate line from the script (ugr.last_login_time = event.sys_created_on;) and adding it into the SAML login script. This just broke the SSO login. I suppose I was probably injecting it in an inappropriate place. I'm going to look at that some more.

If anyone has any experience with getting the last login time working after doing an SSO integration I'd really like to hear from you. Thanks.

Earl

5 REPLIES 5

Earl L
Mega Guru

Crickets... 🙂


Earl L
Mega Guru

Ok, so no one has responded here so there must be some good reason for that. Either its working fine for people and they've never had to mess with it. Or it's not (working fine) and no one cares. Or some other scenarios that I'm not thinking of... 🙂

I did a little investigating, trolling through the table for the sys_user, and found that there are actually two different columns for recording last login; last_login and last_login_time. Since last login is a date and last_login_time is a date/time I can only assume that someone wanted more granularity than date so the last_login_time was added and the last_login was deprecated. Can anyone confirm or deny this rash assumption?

I'm still open to hearing from anyone about how to get the last_login_time recorded when there's a SSO/SAML login script in the middle of the process. 🙂

Earl


mduluk
Giga Expert

Are you looking at 'Last login' or 'last login time'? We are using SSO and the last login time is working fine for us, nothing shows up in the last login column though.


You're absolutely right. Our users form had the last_login field on the form and it was blank for everyone, which is why I started this whole thing. When I put both columns in the list view it was clear that you observed is the same case for us. Thanks so much!

Earl