After changing version from 5.4.1 to 5.5.1 I am getting Exception in below method
@override
public User authenticate(AuthenticationToken authenticationToken) {
UsernamePasswordToken token = (UsernamePasswordToken) authenticationToken;
final String actualUser = token.principal();
final InfoHolder info = usersMap.get(actualUser);
if (info != null && SecuredString.constantTimeEquals(token.credentials(), info.password)) {
return new User(actualUser, info.roles);
}
return null;
}
Error is:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39.197 s
[INFO] Finished at: 2018-03-13T14:25:24+05:30
[INFO] Final Memory: 25M/66M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5:compile (default-compile) on project shieldOAuth: Compilation failure: Compilation failure:
[ERROR] D:...\x-pack-custom-realm\src\main\java\org\elasticsearch\example\realm\CustomRealm.java:[30,53] error: cannot find symbol
[ERROR] symbol: class SecuredString
[ERROR] location: package org.elasticsearch.xpack.security.authc.support
[ERROR] D:...\x-pack-custom-realm\src\main\java\org\elasticsearch\example\realm\CustomCachingRealm.java:[26,53] error: cannot find symbol
[ERROR] -> [Help 1]
[ERROR]
Secured class in not available in other ES versions What should I use instead of
SecuredString.constantTimeEquals(token.credentials(), info.password)
Please suggest what to do in this case?