* Code in this method is copied from ServerRemoteAdminCommand to make it easier for sustaining to port back
* these changes. In trunk, HttpConnectorAddress will be refactored such that all the code below will be
* abstracted into HttpConnectorAddress.
*/
private AuthenticationInfo authenticationInfo(Habitat habitat, SecureAdmin secureAdmin) {
AuthenticationInfo result = null;
if (SecureAdmin.Util.isUsingUsernamePasswordAuth(secureAdmin)) {
final SecureAdminInternalUser secureAdminInternalUser = SecureAdmin.Util.secureAdminInternalUser(secureAdmin);
if (secureAdminInternalUser != null) {
try {
String pw = habitat.getComponent(MasterPassword.class).getMasterPasswordAdapter().getPasswordForAlias(secureAdminInternalUser.getPasswordAlias());
result = new AuthenticationInfo(secureAdminInternalUser.getUsername(), pw);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
}