diff options
author | blsaws <bryan.sullivan@att.com> | 2016-06-14 16:36:23 -0700 |
---|---|---|
committer | blsaws <bryan.sullivan@att.com> | 2016-06-14 16:36:23 -0700 |
commit | 5c856171a061e7ce3f2ee6a28b76e08f907de368 (patch) | |
tree | e27e0572c7ddd790d91afd0bd34c210f44b1d699 /components/congress/test-webapp/www/proxy | |
parent | 6f686820626472268a2abca9d507d7d79a4229e9 (diff) |
Add tenant name, further auth bug fixes
JIRA: COPPER-4
Change-Id: I442d6c26358a193ec77554be38d778c67439a8b4
Signed-off-by: blsaws <bryan.sullivan@att.com>
Diffstat (limited to 'components/congress/test-webapp/www/proxy')
-rw-r--r-- | components/congress/test-webapp/www/proxy/index.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/components/congress/test-webapp/www/proxy/index.php b/components/congress/test-webapp/www/proxy/index.php index af86f1a..39d54d3 100644 --- a/components/congress/test-webapp/www/proxy/index.php +++ b/components/congress/test-webapp/www/proxy/index.php @@ -23,8 +23,12 @@ if ($method == 'OPTIONS') { exit(); } -$token = file_get_contents("/tmp/os_token"); -if ($token === false) { + +if (file_exists("/tmp/os_token")) { + $token = file_get_contents("/tmp/os_token"); + file_put_contents("/tmp/".date('ymd').".log", "proxy.php, auth token=".$token."\n",FILE_APPEND); +} +else { $url = "http://KEYSTONE_HOST:5000/v2.0/tokens"; $curlop = curl_init(); curl_setopt($curlop, CURLOPT_URL, $url); @@ -33,7 +37,7 @@ if ($token === false) { curl_setopt($curlop, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curlop, CURLINFO_HEADER_OUT, true); curl_setopt($curlop, CURLOPT_HTTPHEADER, array("Content-Type: application/json")); - $body = '{"auth": {"passwordCredentials": {"username": "OS_USERNAME", "password": "OS_PASSWORD"}}}'; + $body = '{"auth": {"tenantName": "OS_TENANT_NAME", "passwordCredentials": {"username": "OS_USERNAME", "password": "OS_PASSWORD"}}}'; curl_setopt($curlop, CURLOPT_POSTFIELDS, $body); $req_time=time(); $result = file_put_contents("/tmp/".date('ymd').".log", "proxy.php, ".$req_time.", ".$url.", ".$type.", ".$body."\n",FILE_APPEND); |