diff --git a/keystone/middleware/swift_auth.py b/keystone/middleware/swift_auth.py index 6a858f7515..dfdf8fe3fc 100644 --- a/keystone/middleware/swift_auth.py +++ b/keystone/middleware/swift_auth.py @@ -135,9 +135,9 @@ class SwiftAuth(object): if environ.get('HTTP_X_IDENTITY_STATUS') != 'Confirmed': return roles = [] - if 'HTTP_X_ROLE' in environ: - roles = environ['HTTP_X_ROLE'].split(',') - identity = {'user': environ.get('HTTP_X_USER'), + if 'HTTP_X_ROLES' in environ: + roles = environ['HTTP_X_ROLES'].split(',') + identity = {'user': environ.get('HTTP_X_USER_NAME'), 'tenant': (environ.get('HTTP_X_TENANT_ID'), environ.get('HTTP_X_TENANT_NAME')), 'roles': roles} diff --git a/tests/test_swift_auth_middleware.py b/tests/test_swift_auth_middleware.py index a5a0d674ed..161f1738ff 100644 --- a/tests/test_swift_auth_middleware.py +++ b/tests/test_swift_auth_middleware.py @@ -71,8 +71,8 @@ class SwiftAuth(unittest.TestCase): return dict(X_IDENTITY_STATUS=status, X_TENANT_ID=tenant_id, X_TENANT_NAME=tenant_name, - X_ROLE=role, - X_USER=user) + X_ROLES=role, + X_USER_NAME=user) def _get_successful_middleware(self): response_iter = iter([('200 OK', {}, '')])