Cannot connect to Swift, error 401
Using cURL, I can connect and obtain an X-Auth-Token. But when I attempt to connect back for a HEAD request, using the returned X-Auth-Token and X-Storage-URL, I receive a 401, unauthorized response.
I'm using tempauth.
The following is output from the two cURL commands:
[swift@localhost ~]$ curl -i -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://
* About to connect() to 192.168.30.128 port 8080 (#0)
* Trying 192.168.30.128... connected
* Connected to 192.168.30.128 (192.168.30.128) port 8080 (#0)
> GET /auth/v1.0 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-
> Host: 192.168.30.128:8080
> Accept: */*
> X-Storage-User: test:tester
> X-Storage-Pass: testing
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< X-Storage-Url: http://
X-Storage-Url: http://
< X-Storage-Token: AUTH_tk61345b23
X-Storage-Token: AUTH_tk61345b23
< X-Auth-Token: AUTH_tk61345b23
X-Auth-Token: AUTH_tk61345b23
< Content-Length: 0
Content-Length: 0
< Date: Wed, 06 Nov 2013 22:11:48 GMT
Date: Wed, 06 Nov 2013 22:11:48 GMT
<
* Connection #0 to host 192.168.30.128 left intact
* Closing connection #0
[swift@localhost ~]$ curl -i -v -H 'X-Auth-Token: AUTH_tk61345b23
* About to connect() to 192.168.30.128 port 8080 (#0)
* Trying 192.168.30.128... connected
* Connected to 192.168.30.128 (192.168.30.128) port 8080 (#0)
> GET /auth/v1.0 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-
> Host: 192.168.30.128:8080
> Accept: */*
> X-Auth-Token: AUTH_tk61345b23
>
< HTTP/1.1 401 Unauthorized
HTTP/1.1 401 Unauthorized
< Content-Length: 358
Content-Length: 358
< Content-Type: text/html; charset=UTF-8
Content-Type: text/html; charset=UTF-8
< Date: Wed, 06 Nov 2013 22:12:14 GMT
Date: Wed, 06 Nov 2013 22:12:14 GMT
<
<html>
<head>
<title>401 Unauthorized<
</head>
<body>
<h1>401 Unauthorized</h1>
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 />
</body>
* Connection #0 to host 192.168.30.128 left intact
* Closing connection #0
</html>
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Mehmet Hacısalihoğlu
- Solved:
- Last query:
- Last reply: