Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tenant is considered supplied if tenantName or tenantId are an empty String. #104

Closed
LiamJolly opened this issue Jun 1, 2016 · 0 comments
Closed

Comments

@LiamJolly
Copy link

@LiamJolly LiamJolly commented Jun 1, 2016

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!

LiamJolly pushed a commit to LiamJolly/joss that referenced this issue Jun 6, 2016
Check if tenantName and tenantId are empty as well as null to avoid setting tenantSupplied incorrectly.
Added unit tests to validate the change.
@ferrys ferrys closed this Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants