Jira 无法使用 Seraph SSO DefaultAuthenticator 更新上次登录时间

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

我正在使用我的 Jira 工作站 (v7.12.3) 和我的身份提供者。 我开发了 CustomAuthenticator 并且它工作正常。因此,当我查看管理员面板(特别是 UserBrowser)时,上次登录和登录计数不会更新。

我如何更新从 DefaultAuthenticator 扩展的 CustomAuthenticator 以更新此字段?

我已经解决了这个问题,在识别用户身份验证后添加下面的代码:

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);
}

我已经使用以下 jar 来添加依赖项:

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