diff options
author | Dan Prince <dprince@redhat.com> | 2012-02-25 15:56:38 -0500 |
---|---|---|
committer | Dan Prince <dprince@redhat.com> | 2012-02-25 15:56:38 -0500 |
commit | e23ecc6893db337671f75b6cc069d96a183940e8 (patch) | |
tree | dfaad1f940267de1d03c7fc3a2173d8ade207e25 /keystone | |
parent | b4d35d621908557ac3fba70cbacac7500f79a352 (diff) | |
download | keystone-e23ecc6893db337671f75b6cc069d96a183940e8.tar.gz |
Update auth_token middleware so it sets X_USER_ID.
Fixes LP Bug #941101.
Change-Id: I67b68f6004456eb76003fdcd2ec3fb4c9b9f3bfb
Diffstat (limited to 'keystone')
-rw-r--r-- | keystone/middleware/auth_token.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/keystone/middleware/auth_token.py b/keystone/middleware/auth_token.py index 3ec6f7a9f..44aa47c6a 100644 --- a/keystone/middleware/auth_token.py +++ b/keystone/middleware/auth_token.py @@ -189,13 +189,16 @@ class AuthProtocol(object): # Services should use these self._decorate_request('X_TENANT_NAME', - claims.get('tenant_name', claims['tenant']), + claims.get('tenantName', claims['tenant']), env, proxy_headers) self._decorate_request('X_TENANT_ID', claims['tenant'], env, proxy_headers) self._decorate_request('X_USER', + claims['userName'], env, proxy_headers) + self._decorate_request('X_USER_ID', claims['user'], env, proxy_headers) + if 'roles' in claims and len(claims['roles']) > 0: if claims['roles'] != None: roles = '' @@ -353,7 +356,9 @@ class AuthProtocol(object): if not tenant: tenant = token_info['access']['user'].get('tenantId') tenant_name = token_info['access']['user'].get('tenantName') - verified_claims = {'user': token_info['access']['user']['username'], + verified_claims = { + 'user': token_info['access']['user']['id'], + 'userName': token_info['access']['user']['username'], 'tenant': tenant, 'roles': roles} if tenant_name: |