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

Auto-discover a single tenant if not supplied with the Authentication call #30

Closed
robert-bor opened this issue May 11, 2013 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@robert-bor
Copy link
Contributor

@robert-bor robert-bor commented May 11, 2013

At trystack.org initially you do not have a tenant ID/name. If you place an authentication call to Keystone without providing a tenant, you will not get the applicable endpoints. You will have to go through a number of stages to retrieve the tenant and pass this in the auth call

  1. send the auth call with username/password
  2. use the authentication token to get the tenant list
  3. send the auth call (again), this time also with the tenant ID and/or name

Step 1

curl -k -X 'POST' -v http://x86.trystack.org:5000/v2.0/tokens 
-d '{"auth":{"passwordCredentials":{"username": "********", "password":"********"} }}' 
-H 'Content-type: application/json'

Step 2

Replace "[INSERT_AUTH_TOKEN_HERE]" with the token ID found in the response of the previous call

curl -H "X-Auth-Token: [INSERT_AUTH_TOKEN_HERE]" http://x86.trystack.org:5000/v2.0/tenants

Step 3

Replace "[INSERT_TENANT_ID_HERE]" with the tenant ID found in the response of the previous call
Replace "[INSERT_TENANT_NAME_HERE]" with the tenant name found in the response of the previous call

curl -k -X 'POST' -v http://x86.trystack.org:5000/v2.0/tokens 
-d '{"auth":{"passwordCredentials":{"username": "********", "password":"********"}, 
"tenantId":"[INSERT_TENANT_ID_HERE]", 
"tenantName":"[INSERT_TENANT_NAME_HERE]" }}' 
-H 'Content-type: application/json'

In practice, there is probably only one tenant per username/password combination. If this is the case, JOSS should be able to auto-determine the tenant from the array of tenants and place the authentication again with the found tenant.

@ghost ghost assigned robert-bor May 11, 2013
robert-bor added a commit that referenced this issue May 12, 2013
…irst tenant found. Algorithm needs to be made a bit smarter than this and fetch a tenant if there is one (and only one) enabled tenant. In all other cases, it must throw an exception.
robert-bor added a commit that referenced this issue May 12, 2013
…ne be chosen. Otherwise, an exception is thrown
robert-bor added a commit that referenced this issue May 12, 2013
…ogic in AbstractClient, paving the way for tenant discovery in mock mode
robert-bor added a commit that referenced this issue May 12, 2013
…ow fully depends on its configuration (ie, AccountConfig) in order to combine paths
robert-bor added a commit that referenced this issue May 12, 2013
… would be nice to have multi-tenant accounts in mock mode, which act as such as well. Perhaps in the future
robert-bor added a commit that referenced this issue May 12, 2013
…e, second time overwriting the first value and leaving tenantName empty.
@robert-bor robert-bor closed this May 12, 2013
katta pushed a commit to twxkit/joss that referenced this issue Oct 6, 2014
…rns the first tenant found. Algorithm needs to be made a bit smarter than this and fetch a tenant if there is one (and only one) enabled tenant. In all other cases, it must throw an exception.
katta pushed a commit to twxkit/joss that referenced this issue Oct 6, 2014
…e, will one be chosen. Otherwise, an exception is thrown
katta pushed a commit to twxkit/joss that referenced this issue Oct 6, 2014
… shared logic in AbstractClient, paving the way for tenant discovery in mock mode
katta pushed a commit to twxkit/joss that referenced this issue Oct 6, 2014
…hod. It now fully depends on its configuration (ie, AccountConfig) in order to combine paths
katta pushed a commit to twxkit/joss that referenced this issue Oct 6, 2014
… well. It would be nice to have multi-tenant accounts in mock mode, which act as such as well. Perhaps in the future
katta pushed a commit to twxkit/joss that referenced this issue Oct 6, 2014
…ntId twice, second time overwriting the first value and leaving tenantName empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.