-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Login api request frequently when disabled auth with 2.x client. #11494
Comments
Current bug has simple fixed by #11495 . Next version server will return |
And I see the BCrypt check logic, It seems no normal way to do this cache. So maybe community need to discuss whether use this solution. |
And for client logic, I see the old version client like 1.4.X. The token only check response status and token field exist. I think new version client should follow old logic. |
JwtTokenManager{
public String createToken(String userName) {
//if (!authConfigs.isAuthEnabled()) {
//return StringUtils.EMPTY;
//}
checkJwtParser();
return jwtParser.jwtBuilder().setUserName(userName).setExpiredTime(this.tokenValidityInSeconds).compact();
}
public long getTokenTtlInSeconds(String token) throws AccessException {
if (!authConfigs.isAuthEnabled()) {
//TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())+tokenValidityInSeconds;
return tokenValidityInSeconds;
}
return jwtParser.getExpireTimeInSeconds(token) - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis());
}
} 需要正常返回登录token以及ttl, |
welcome new issues and new PR. |
Describe the bug
When disable auth and use 2.x client with username and password. The
login
API will be request frequently, and thelogin
API high using CPU to doBCrypt
.The problem is caused by the enhancement after 2.2 I think, when auth diasbled, the server will return empty token and the 2.X client will think the empty token is illegal and do retry after 5s.
Expected behavior
login
API request by normally.Actually behavior
login
API request by frequently.How to Reproduce
Steps to reproduce the behavior:
Additional context
In fact, the right usage is no config
username
andpassword
. But we can force users to remove the config.So I think community can do some enhance to reduce these problem.
The text was updated successfully, but these errors were encountered: