}
private AuthenticationResult authenticateCramMd5(String userName, String userPassword) throws SaslException, Exception
{
SaslServer ss = _authenticationManager.createSaslServer("CRAM-MD5", "test", null);
byte[] challenge = ss.evaluateResponse(new byte[0]);
byte[] response = SaslUtil.generateCramMD5ClientResponse(userName, userPassword, challenge);
AuthenticationResult result = _authenticationManager.authenticate(ss, response);
return result;
}