Forums

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

Jira can't update last login time with Seraph SSO DefaultAuthenticator

Alexandre_Barreiro_Neto
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!
June 17, 2020

Hi,

I'am using my Jira workstation (v7.12.3) with my Identity Provider.
I had developed CustomAuthenticator and this works correctly. Therefore, when i look the Administrator Panel (specifically UserBrowser) the Last Login and Login Count aren't update.

How i update my CustomAuthenticator that extends from DefaultAuthenticator to update this field?

image.png

1 answer

1 accepted

0 votes
Answer accepted
Alexandre_Barreiro_Neto
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!
June 18, 2020

I have solution this issue adding the code bellow after identify user authenticated:

import com.atlassian.jira.user.ApplicationUser;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.security.login.LoginStore;

// after identify user authenticated add this code:
ApplicationUser userComponentAccessor = ComponentAccessor.getUserManager().getUserByName(username);
updateUserAttributes(userComponentAccessor); // close get user method private void updateUserAttributes(ApplicationUser user) { LoginStore loginStore = ComponentAccessor.getComponentOfType(LoginStore.class);
loginStore
.recordLoginAttempt(user, true); }

I have had using the followed jars to add the dependency:

https://mvnrepository.com/artifact/com.atlassian.seraph/atlassian-seraph/4.0.0
https://mvnrepository.com/artifact/com.atlassian.jira/jira-api/7.2.14 
https://mvnrepository.com/artifact/com.atlassian.jira/jira-core/7.1.2

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events