Using the following config;
AccountConfig config = new AccountConfig();
config.setUsername("username");
config.setPassword("password");
config.setAuthUrl("authurl");
config.setTenantName("");
config.setTenantId("");
account = new AccountFactory(config).createAccount();
I noticed that I was unable to authenticate, instead I got the following;
Command exception, HTTP Status code: 404 => NO_SERVICE_CATALOG_FOUND
Not setting the tenantName or tenantId seemed to resolve the issue. Looking at KeystoneAuthenticationCommandImpl, I noticed that it's checking if tenantName and tenantId are not null but does not consider if the strings are empty;
private void setTenantSupplied(String tenantName, String tenantId) {
this.tenantSupplied = tenantName != null || tenantId != null;
}
To work around this I just avoided setting the tenantName or tenantId if I found that they were null or empty.
Apologies if this is covering a use case that has already been considered!