mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-15 04:52:09 +08:00
captcha config
This commit is contained in:
@@ -203,8 +203,7 @@ public abstract class AbstractAuthenticationProvider {
|
||||
*/
|
||||
protected void captchaValid(String captcha, String authType) {
|
||||
// for basic
|
||||
if (applicationConfig.getLoginConfig().isCaptcha()
|
||||
&& authType.equalsIgnoreCase(AuthType.NORMAL)) {
|
||||
if (authType.equalsIgnoreCase(AuthType.NORMAL)) {
|
||||
_logger.info("captcha : "
|
||||
+ WebContext.getSession().getAttribute(
|
||||
WebConstants.KAPTCHA_SESSION_KEY).toString());
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.maxkey.authn.online.OnlineTicketServices;
|
||||
import org.maxkey.authn.realm.AbstractAuthenticationRealm;
|
||||
import org.maxkey.authn.support.rememberme.AbstractRemeberMeService;
|
||||
import org.maxkey.configuration.ApplicationConfig;
|
||||
import org.maxkey.entity.Institutions;
|
||||
import org.maxkey.entity.UserInfo;
|
||||
import org.maxkey.password.onetimepwd.AbstractOtpAuthn;
|
||||
import org.maxkey.password.onetimepwd.OtpAuthnService;
|
||||
@@ -84,8 +85,11 @@ public class RealmAuthenticationProvider extends AbstractAuthenticationProvider
|
||||
//jwtTokenValid(j_jwtToken);
|
||||
|
||||
authTypeValid(loginCredential.getAuthType());
|
||||
|
||||
captchaValid(loginCredential.getCaptcha(),loginCredential.getAuthType());
|
||||
|
||||
Institutions inst = (Institutions)WebContext.getAttribute(WebConstants.CURRENT_INST);
|
||||
if(inst.getCaptcha().equalsIgnoreCase("YES")) {
|
||||
captchaValid(loginCredential.getCaptcha(),loginCredential.getAuthType());
|
||||
}
|
||||
|
||||
emptyPasswordValid(loginCredential.getPassword());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user