Hello all,<br><br>During the last few days I've been struggling to get Swift to use Keystone middleware. Problem is that even if Keystone works fine  when trying to access the Swift  configured with Keystone middleware I keep getting 401s, no matter how I try i.e. which Swift url I try to access (admin_url, internal or public):<br>

<br>So, after quite a bit of researching, collaborating different docs (outdated to different degrees...)  I found someone experienced the exact same symptioms --  Question #179733 on Launchpad Q&A <a href="https://answers.launchpad.net/swift/+question/179733" target="_blank">https://answers.launchpad.net/swift/+question/179733</a><br>

<br>Now, I don't want to make this too long a mail by copy&paste too much inline, so I've posted most of the stuff (commands, MySQL tables configu files  etc.) here: <br><br><a href="http://pastebin.com/6YGzV9PA" target="_blank">http://pastebin.com/6YGzV9PA</a><br>
<br>My Setup is Ubuntu 11.10 x64, running "2011.3-d5-rcb8~oneiric" packages from <a href="http://ops.rcb.me/packages/">http://ops.rcb.me/packages/</a><br><br>My questions: <br><br>1) The format of the curl requests while testing keystone:<br>
<br>For some reasons the format of curl requests (and returns) is different as from the latest docs. I.e. this works: <br><br>curl -s -d '{"tenantName": "MyTenant", "passwordCredentials": {"username": "myuser", "password": "mypassword"}}' -H 'Content-type: application/json' <a href="http://10.2.20.51:5001/v2.0/tokens">http://10.2.20.51:5001/v2.0/tokens</a><br>
<br>{"auth": {"token": {"expires": "2015-02-05T00:00:00", "id": "999888777666"}, "serviceCatalog": {"keystone": [{"adminURL": "<a href="http://10.2.20.51:5001/v2.0">http://10.2.20.51:5001/v2.0</a>", "region": "RegionOne", "internalURL": "<a href="http://10.2.20.51:5000/v2.0">http://10.2.20.51:5000/v2.0</a>", "publicURL": "<a href="http://10.2.20.51:5000/v2.0">http://10.2.20.51:5000/v2.0</a>"}], "glance": [{"adminURL": "<a href="http://10.2.20.51:9292/v1.1/MyTenant">http://10.2.20.51:9292/v1.1/MyTenant</a>", "region": "RegionOne", "internalURL": "<a href="http://10.2.20.51:9292/v1.1/MyTenant">http://10.2.20.51:9292/v1.1/MyTenant</a>", "publicURL": "<a href="http://10.2.20.51:9292/v1.1/MyTenant">http://10.2.20.51:9292/v1.1/MyTenant</a>"}], "swift": [{"adminURL": "<a href="http://10.2.20.51:8080/">http://10.2.20.51:8080/</a>", "region": "RegionOne", "internalURL": "<a href="http://10.2.20.51:8080/v1/AUTH_MyTenant">http://10.2.20.51:8080/v1/AUTH_MyTenant</a>", "publicURL": "<a href="http://10.2.20.51:8080/v1/AUTH_MyTenant">http://10.2.20.51:8080/v1/AUTH_MyTenant</a>"}], "nova": [{"adminURL": "<a href="http://10.2.20.51:8774/v1.1/MyTenant">http://10.2.20.51:8774/v1.1/MyTenant</a>", "region": "RegionOne", "internalURL": "<a href="http://10.2.20.51:8774/v1.1/MyTenant">http://10.2.20.51:8774/v1.1/MyTenant</a>", "publicURL": "<a href="http://10.2.20.51:8774/v1.1/MyTenant">http://10.2.20.51:8774/v1.1/MyTenant</a>"}]}}}<br>
<br><br>.... But specifying "auth" fails with a 400 code: <br><br>root@Swift1:/etc/swift# curl -s -d '{"auth": {"tenantName": "MyTenant", "passwordCredentials": {"username": "myuser", "password": "mypassword"}}}' -H 'Content-type: application/json' <a href="http://10.2.20.51:5001/v2.0/tokens">http://10.2.20.51:5001/v2.0/tokens</a> | python -mjson.tool<br>
{<br>    "badRequest": {<br>        "code": "400", <br>        "message": "Expecting passwordCredentials"<br>    }<br>}<br><br><br> Any suggestions ? Am I missing something ?<br>
<br><br>2)  In all the references I found the format of the Swift "admin_url" in the endpointTemplate. I used "<IP>:8080", for the admin_url whereas the internal and public are parameterized with %tenant_id% e.g. "<a href="http://10.2.20.51:8080/v1/AUTH_%tenant_id%">http://10.2.20.51:8080/v1/AUTH_%tenant_id%</a>"  . Is this correct i.e. not even a version number ? <br>
      <br>3) Last but most importantly -- my problem:  Accessing Swift admin_url, internal / public  with the "keystone_admin_token" does result in a 401 (coyping only the attempt to access the admin_url here): <br>
<br>root@Swift1:~# curl -v -H 'X-Auth-Token: AUTH_999888777666' <a href="http://10.2.20.51:8080">http://10.2.20.51:8080</a><br>* About to connect() to 10.2.20.51 port 8080 (#0)<br>*   Trying 10.2.20.51... connected<br>
* Connected to 10.2.20.51 (10.2.20.51) port 8080 (#0)<br>> GET / HTTP/1.1<br>> User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.21.6 OpenSSL/1.0.0e zlib/<a href="http://1.2.3.4">1.2.3.4</a> libidn/1.22 librtmp/2.3<br>
> Host: <a href="http://10.2.20.51:8080">10.2.20.51:8080</a><br>> Accept: */*<br>> X-Auth-Token: AUTH_999888777666<br>> <br>< HTTP/1.1 401 Unauthorized<br>< Content-Length: 358<br>< Content-Type: text/html; charset=UTF-8<br>
< X-Trans-Id: txec38e4f2018240ffad2aeff57936cd96<br>< Date: Thu, 23 Feb 2012 20:03:35 GMT<br>< <br><html><br> <head><br>  <title>401 Unauthorized</title><br> </head><br> <body><br>
  <h1>401 Unauthorized</h1><br>  This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.<br /><br /><br>
<br><br>Sorry for cross-posting this on this list (instead of following up on  Question #179733 on launchpad) but the question on Launchpad doesn't list a resolution and  I couldn't get in touch with the person that originally posted it. <br>
<br>Kind thanks in advance for the help,<br><br>Florian Otel<br><br>