mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-08 01:48:33 +08:00
提交短信认证后端逻辑判断
This commit is contained in:
parent
756993053b
commit
0bd384b76a
@ -49,7 +49,7 @@ public class LoginCredential implements Authentication {
|
|||||||
ArrayList<GrantedAuthority> grantedAuthority;
|
ArrayList<GrantedAuthority> grantedAuthority;
|
||||||
boolean authenticated;
|
boolean authenticated;
|
||||||
boolean roleAdministrators;
|
boolean roleAdministrators;
|
||||||
|
String mobile;
|
||||||
/**
|
/**
|
||||||
* BasicAuthentication.
|
* BasicAuthentication.
|
||||||
*/
|
*/
|
||||||
@ -230,6 +230,15 @@ public class LoginCredential implements Authentication {
|
|||||||
this.instId = instId;
|
this.instId = instId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMobile() {
|
||||||
|
return mobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMobile(String mobile) {
|
||||||
|
this.mobile = mobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
@ -241,6 +250,8 @@ public class LoginCredential implements Authentication {
|
|||||||
builder.append(password);
|
builder.append(password);
|
||||||
builder.append(", state=");
|
builder.append(", state=");
|
||||||
builder.append(state);
|
builder.append(state);
|
||||||
|
builder.append(", mobile=");
|
||||||
|
builder.append(mobile);
|
||||||
builder.append(", captcha=");
|
builder.append(", captcha=");
|
||||||
builder.append(captcha);
|
builder.append(captcha);
|
||||||
builder.append(", otpCaptcha=");
|
builder.append(", otpCaptcha=");
|
||||||
|
|||||||
@ -74,6 +74,11 @@ public class MobileAuthenticationProvider extends AbstractAuthenticationProvider
|
|||||||
loginCredential.getPrincipal(), getProviderName());
|
loginCredential.getPrincipal(), getProviderName());
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
//如果是验证码登录,设置mobile为username
|
||||||
|
loginCredential.setUsername(loginCredential.getMobile());
|
||||||
|
//设置密码为验证码
|
||||||
|
loginCredential.setPassword(loginCredential.getOtpCaptcha());
|
||||||
|
|
||||||
_logger.debug("authentication " + loginCredential);
|
_logger.debug("authentication " + loginCredential);
|
||||||
|
|
||||||
emptyPasswordValid(loginCredential.getPassword());
|
emptyPasswordValid(loginCredential.getPassword());
|
||||||
@ -84,8 +89,8 @@ public class MobileAuthenticationProvider extends AbstractAuthenticationProvider
|
|||||||
|
|
||||||
statusValid(loginCredential , userInfo);
|
statusValid(loginCredential , userInfo);
|
||||||
|
|
||||||
//Validate PasswordPolicy
|
//Validate PasswordPolicy 取消密码策略验证
|
||||||
authenticationRealm.getPasswordPolicyValidator().passwordPolicyValid(userInfo);
|
//authenticationRealm.getPasswordPolicyValidator().passwordPolicyValid(userInfo);
|
||||||
|
|
||||||
mobileCaptchaValid(loginCredential.getPassword(),userInfo);
|
mobileCaptchaValid(loginCredential.getPassword(),userInfo);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user