trungn1992 / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

HTTP Access Denied when trying to use RESTful API #127

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Running the attached script (after replacing the username and password with 
appropriate values for an account you have at CloudApp)

What is the expected output? What do you see instead?

A joson array with listing of Items from the account. Instead i receive a 'HTTP 
Access Denied'

What version of the product are you using? On what operating system?

I am using the latest version checked out from the git-repository on Debian 
Linux unstable.

Please provide any additional information below.

The cloud uses Restful API and utilizes HTTP Digest to authenticate all 
requests. My loging and password are accurate as they work with this API 
wrapper http://developer.getcloudapp.com/python-wrapper.

I am not entirely certain if this is a bug in the library, any help along the 
direction would be useful. Thank you.

Original issue reported on code.google.com by anuj.sha...@gmail.com on 27 Jan 2011 at 7:28

Attachments:

GoogleCodeExporter commented 8 years ago
That server does not correctly implement Digest authentication. In order for 
Digest authentication to work, the server must respond to an unauthenticated 
request with a 401 status code and a WWW-Authenticate challenge header, neither 
of which that server does:

$ curl --include http://my.cl.ly/items 
HTTP/1.1 302 Moved Temporarily
Server: nginx/0.7.67
Date: Thu, 27 Jan 2011 12:59:49 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Location: http://my.cl.ly/login
X-Runtime: 1
Set-Cookie: 
_cloudapp_session=BAh7BzoPc2Vzc2lvbl9pZCIlODE5YjU4MzhhYjdlYzJhMjRjZDgwMzA2MzQ0Zj
FmNmI6DnJldHVybl90byILL2l0ZW1z--5bd59eccc7a25d6a08789000fc8b5c12a8dc412c; 
path=/; HttpOnly
Cache-Control: no-cache
Content-Length: 87
X-Varnish: 685953129
Age: 0
Via: 1.1 varnish

<html><body>You are being <a 
href="http://my.cl.ly/login">redirected</a>.</body></html>

Original comment by joe.gregorio@gmail.com on 27 Jan 2011 at 1:00