Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

We are running our SSO login module, we want to update the last login time stamp on successful login

Munish J
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 10, 2024

We are running our SSO login module, we want to update the last login time stamp on successful login. How can we implement or update the attribute that stores the last login time stamp on success. Currently we authorize the user but don't see the login time stamp updated at all. In spite of the fact that user get's authenticated stored in session and login successfully.

 

We have tried few things like: 


private void updateLastLoginTimeStamp(ConfluenceUser confUser) {
if(confUser!=null)
new UserLoginInfo(confUser).setLastSuccessfulLoginDate(new Date());
new UserLoginInfo(confUser).setPreviousSuccessfulLoginDate(new Date());
}
It has not worked for us, yet. What exactly do we need to call the change the cwd_user_attribute table that has attribute_name = 'lastAuthenticated'
OR is there something else that has to be updated on db. Please advise, as this is urgent and a show stopper for us before we buy the datacenter licence.

1 answer

0 votes
Munish J
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 10, 2024

WE found the solution, where we have to manually call the following piece of code:

LoginManager loginManager = (LoginManager) ContainerManager.getComponent("loginManager");

    loginManager.onSuccessfulLoginAttempt(username, request);

 

by explicitly calling onSuccessfulLoginAttempt method, it updates the last login timestamp for user who logs-in through SSO.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events