Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Token.using.token #50

Closed
wants to merge 2 commits into from

2 participants

@amol

The API Reference for identity service specifies that token can be generated using existing token, which was not supported by SL driver. Modified the common/sl/auth.py to read token and generate new.

Nathan Beitt... and others added some commits
Nathan Beittenmiller Merge pull request #44 from bodenr/bodenr/authn-tenant
validate tenant id against account id during authN
d975f5c
@amol amol Generates new token from old token.
The API Specification http://api.openstack.org/api-ref-identity.html
allows users to authenticate and generate token from old token. Request
body format:
{
    "auth" :
        { "token" : {"id" : "old_token"} }
}
40c33fe
@amol

My mistake needs to be changed.

@sudorandom
Collaborator

The only issue I have with this is that it doesn't work with a password-based auth. The token won't have an 'api_key' but a 'hashToken'. This also will greatly conflict with the work that @bodenr is doing in #48. I recommend working off of his branch since his pull request is close to being pulled in.

@amol amol referenced this pull request
Closed

Token Using Token #57

@sudorandom
Collaborator

I assume this is okay to close due to #59?

@amol

Yes, right.

@sudorandom sudorandom closed this
@amol amol deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 26, 2014
  1. @amol

    Merge pull request #44 from bodenr/bodenr/authn-tenant

    Nathan Beittenmiller authored amol committed
    validate tenant id against account id during authN
  2. @amol

    Generates new token from old token.

    amol authored
    The API Specification http://api.openstack.org/api-ref-identity.html
    allows users to authenticate and generate token from old token. Request
    body format:
    {
        "auth" :
            { "token" : {"id" : "old_token"} }
    }
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 2 deletions.
  1. +8 −2 jumpgate/common/sl/auth.py
View
10 jumpgate/common/sl/auth.py
@@ -28,8 +28,14 @@ def get_token_details(token, tenant_id=None):
def get_new_token(credentials):
- username = lookup(credentials, 'auth', 'passwordCredentials', 'username')
- credential = lookup(credentials, 'auth', 'passwordCredentials', 'password')
+ token = lookup(credentials, 'auth', 'token', 'id')
+ if token:
+ token_details = get_token_details(token)
+ username = token_details['username']
+ credential = token_details['api_key']
+ else:
+ username = lookup(credentials, 'auth', 'passwordCredentials', 'username')
+ credential = lookup(credentials, 'auth', 'passwordCredentials', 'password')
def assert_tenant(user):
tenant = lookup(credentials, 'auth', 'tenantId')
Something went wrong with that request. Please try again.