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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.