From a60978ed73227f6087ddad6a024e0a04255e35c5 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Thu, 13 Nov 2014 16:24:29 -0500 Subject: [PATCH] Project ID in OAuth headers was missing If running Keystone under Apache with mod_wsgi, the extra headers were not being passed forward. These headers include: i) the Requested_Project_Id header, and ii) The Authorization headers with the oauth values. For i) we have to rename the header to use dashes (-), and not underscores (_), since mod_wsgi does not propogate the header otherwise. For ii) we need to add `WSGIPassAuthorization On` in the keystone vhost file. This should be done on the server side. For more info see note #2 here: http://modwsgi.readthedocs.org/en/latest/release-notes/version-4.3.0.html#bugs-fixed Closes-Bug: #1392584 Change-Id: Id84e883b357408d25797155a72119f4c9898ca76 --- keystoneclient/tests/v3/test_oauth1.py | 2 +- keystoneclient/v3/contrib/oauth1/request_tokens.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keystoneclient/tests/v3/test_oauth1.py b/keystoneclient/tests/v3/test_oauth1.py index d12ffdd74..ff0d83677 100644 --- a/keystoneclient/tests/v3/test_oauth1.py +++ b/keystoneclient/tests/v3/test_oauth1.py @@ -182,7 +182,7 @@ class RequestTokenTests(TokenTests): self.assertEqual(request_secret, request_token.secret) # Assert that the project id is in the header - self.assertRequestHeaderEqual('requested_project_id', project_id) + self.assertRequestHeaderEqual('requested-project-id', project_id) req_headers = self.requests.last_request.headers oauth_client = oauth1.Client(consumer_key, diff --git a/keystoneclient/v3/contrib/oauth1/request_tokens.py b/keystoneclient/v3/contrib/oauth1/request_tokens.py index bc30ce08d..33ecc3ad7 100644 --- a/keystoneclient/v3/contrib/oauth1/request_tokens.py +++ b/keystoneclient/v3/contrib/oauth1/request_tokens.py @@ -58,7 +58,7 @@ class RequestTokenManager(base.CrudManager): def create(self, consumer_key, consumer_secret, project): endpoint = utils.OAUTH_PATH + '/request_token' - headers = {'requested_project_id': base.getid(project)} + headers = {'requested-project-id': base.getid(project)} oauth_client = oauth1.Client(consumer_key, client_secret=consumer_secret, signature_method=oauth1.SIGNATURE_HMAC,