增加认证日志

This commit is contained in:
2023-08-30 09:30:04 +08:00
parent 2f7c830227
commit 79acf804d7
2 changed files with 6 additions and 9 deletions

View File

@@ -38,10 +38,7 @@ import java.security.Principal;
import java.security.interfaces.RSAPublicKey;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
/**
* @author hongawen
@@ -65,8 +62,6 @@ public class AuthController extends BaseController {
private final UserTokenService userTokenService;
@ApiIgnore
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.AUTHENTICATE)
@ApiOperation("登录认证")
@@ -86,6 +81,7 @@ public class AuthController extends BaseController {
String methodDescribe = getMethodDescribe("postAccessToken");
String username = parameters.get(SecurityConstants.USERNAME);
String grantType = parameters.get(SecurityConstants.GRANT_TYPE);
log.error("登录参数为:" + parameters);
if (grantType.equalsIgnoreCase(SecurityConstants.GRANT_CAPTCHA)) {
username = DesUtils.aesDecrypt(username);
} else if (grantType.equalsIgnoreCase(SecurityConstants.GRANT_SMS_CODE)) {

View File

@@ -76,6 +76,7 @@ public class CaptchaTokenGranter extends AbstractTokenGranter {
userAuth = authenticationManager.authenticate(userAuth);
} catch (AccountStatusException | BadCredentialsException ase) {
//covers expired, locked, disabled cases
ase.printStackTrace();
throw new InvalidGrantException(ase.getMessage());
}
// If the username/password are wrong the spec says we should send 400/invalid grant