}
if (node.isMaster() && node.joined() && node.isActive()) {
final MemberInfo newMemberInfo = new MemberInfo(joinMessage.getAddress(), joinMessage.getUuid(), joinMessage.getAttributes());
if (node.securityContext != null && !setJoins.contains(newMemberInfo)) {
final Credentials cr = joinMessage.getCredentials();
ILogger securityLogger = node.loggingService.getLogger("com.hazelcast.security");
if (cr == null) {
securityLogger.severe("Expecting security credentials " +
"but credentials could not be found in JoinRequest!");
nodeEngine.getOperationService().send(new AuthenticationFailureOperation(), joinMessage.getAddress());
return;
} else {
try {
LoginContext lc = node.securityContext.createMemberLoginContext(cr);
lc.login();
} catch (LoginException e) {
securityLogger.severe("Authentication has failed for " + cr.getPrincipal()
+ '@' + cr.getEndpoint() + " => (" + e.getMessage() +
")");
securityLogger.finest(e);
nodeEngine.getOperationService().send(new AuthenticationFailureOperation(), joinMessage.getAddress());
return;
}
}
}