String authMode = jolokiaConfig.get(ConfigKey.AUTH_MODE);
String realm = jolokiaConfig.get(ConfigKey.REALM);
if ("basic".equalsIgnoreCase(authMode)) {
authenticator = new UserPasswordAuthenticator(realm,user,password);
} else if ("jaas".equalsIgnoreCase(authMode)) {
authenticator = new JaasAuthenticator(realm);
} else {
throw new IllegalArgumentException("No auth method '" + authMode + "' known. " +
"Must be either 'basic' or 'jaas'");
}
} else {