if (credentials == null) {
if (_debug) {
System.out.println("JMXAuthenticator: Null credentials sent from the client");
}
throwInvalidCredentialsException();
}
if (!(credentials instanceof String[])) {
if (_debug) {
System.out.println("JMXAuthenticator: Invalid credentials sent from the client " + credentials.getClass().getName());
}
throwInvalidCredentialsException();
}
String[] userpass = (String[])credentials;
if (userpass.length != 2) {
if (_debug) {
System.out.println("JMXAuthenticator: Invalid credentials sent from client, string array of length " + userpass.length);
}
throwInvalidCredentialsException();
}
if (_debug) {
System.out.println("JMX authentication request for user "
+ userpass[0] + " and password " + userpass[1]);
System.out.println("Authentication realm is " + realmName);
}
Subject subject = null;
if (loginDriver != null) {
subject = loginDriver.login(userpass[0], userpass[1], realmName);
} else {
// TODO: WARNING message, JMX connector not protected
}
return subject;