This commit is contained in:
MaxKey
2021-02-16 09:17:55 +08:00
parent 0f19da93f4
commit c110fee2b1
8 changed files with 47 additions and 47 deletions

View File

@@ -52,7 +52,7 @@ public abstract class AbstractAuthenticationProvider {
protected AbstractAuthenticationRealm authenticationRealm;
protected AbstractOtpAuthn tfaOptAuthn;
protected AbstractOtpAuthn tfaOtpAuthn;
protected AbstractRemeberMeService remeberMeService;
@@ -227,7 +227,7 @@ public abstract class AbstractAuthenticationProvider {
validUserInfo.setSharedSecret(sharedSecret);
validUserInfo.setSharedCounter(userInfo.getSharedCounter());
validUserInfo.setId(userInfo.getId());
if (otpCaptcha == null || !tfaOptAuthn.validate(validUserInfo, otpCaptcha)) {
if (otpCaptcha == null || !tfaOtpAuthn.validate(validUserInfo, otpCaptcha)) {
String message = WebContext.getI18nValue("login.error.captcha");
_logger.debug("login captcha valid error.");
throw new BadCredentialsException(message);
@@ -320,8 +320,8 @@ public abstract class AbstractAuthenticationProvider {
this.authenticationRealm = authenticationRealm;
}
public void setTfaOptAuthn(AbstractOtpAuthn tfaOptAuthn) {
this.tfaOptAuthn = tfaOptAuthn;
public void setTfaOtpAuthn(AbstractOtpAuthn tfaOtpAuthn) {
this.tfaOtpAuthn = tfaOtpAuthn;
}
public void setRemeberMeService(AbstractRemeberMeService remeberMeService) {

View File

@@ -61,12 +61,12 @@ public class RealmAuthenticationProvider extends AbstractAuthenticationProvider
public RealmAuthenticationProvider(
AbstractAuthenticationRealm authenticationRealm,
ApplicationConfig applicationConfig,
AbstractOtpAuthn tfaOptAuthn,
AbstractOtpAuthn tfaOtpAuthn,
AbstractRemeberMeService remeberMeService,
OnlineTicketServices onlineTicketServices) {
this.authenticationRealm = authenticationRealm;
this.applicationConfig = applicationConfig;
this.tfaOptAuthn = tfaOptAuthn;
this.tfaOtpAuthn = tfaOtpAuthn;
this.remeberMeService = remeberMeService;
this.onlineTicketServices = onlineTicketServices;
}

View File

@@ -80,7 +80,7 @@ public class AuthenticationAutoConfiguration implements InitializingBean {
public AbstractAuthenticationProvider authenticationProvider(
AbstractAuthenticationRealm authenticationRealm,
ApplicationConfig applicationConfig,
AbstractOtpAuthn tfaOptAuthn,
AbstractOtpAuthn tfaOtpAuthn,
AbstractRemeberMeService remeberMeService,
OnlineTicketServices onlineTicketServices
) {
@@ -88,7 +88,7 @@ public class AuthenticationAutoConfiguration implements InitializingBean {
return new RealmAuthenticationProvider(
authenticationRealm,
applicationConfig,
tfaOptAuthn,
tfaOtpAuthn,
remeberMeService,
onlineTicketServices
);