//save clientProperties
setClientProperties(clientProperties);
setSaslServer(ss);
final SubjectAuthenticationResult authResult = subjectCreator.authenticate(ss, response);
MethodRegistry methodRegistry = getMethodRegistry();
switch (authResult.getStatus())
{
case ERROR:
Exception cause = authResult.getCause();
_logger.info("Authentication failed:" + (cause == null ? "" : cause.getMessage()));
closeConnection(AMQConstant.NOT_ALLOWED, "Authentication failed", 0);
disposeSaslServer();
break;
case SUCCESS:
if (_logger.isInfoEnabled())
{
_logger.info("Connected as: " + authResult.getSubject());
}
setAuthorizedSubject(authResult.getSubject());
int frameMax = broker.getContextValue(Integer.class, Broker.BROKER_FRAME_SIZE);
if (frameMax <= 0)
{
frameMax = Integer.MAX_VALUE;
}
ConnectionTuneBody
tuneBody =
methodRegistry.createConnectionTuneBody(broker.getConnection_sessionCountLimit(),
frameMax,
broker.getConnection_heartBeatDelay());
writeFrame(tuneBody.generateFrame(0));
break;
case CONTINUE:
ConnectionSecureBody
secureBody = methodRegistry.createConnectionSecureBody(authResult.getChallenge());
writeFrame(secureBody.generateFrame(0));
}
}
}
catch (SaslException e)