{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/pyocclient/issues/160","repository_url":"https://api.github.com/repos/owncloud/pyocclient","labels_url":"https://api.github.com/repos/owncloud/pyocclient/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/pyocclient/issues/160/comments","events_url":"https://api.github.com/repos/owncloud/pyocclient/issues/160/events","html_url":"https://github.com/owncloud/pyocclient/issues/160","id":152730574,"number":160,"title":"pyocclient not sending basic auth headers","user":{"login":"lz1irq","id":3308910,"avatar_url":"https://avatars.githubusercontent.com/u/3308910?v=3","gravatar_id":"","url":"https://api.github.com/users/lz1irq","html_url":"https://github.com/lz1irq","followers_url":"https://api.github.com/users/lz1irq/followers","following_url":"https://api.github.com/users/lz1irq/following{/other_user}","gists_url":"https://api.github.com/users/lz1irq/gists{/gist_id}","starred_url":"https://api.github.com/users/lz1irq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lz1irq/subscriptions","organizations_url":"https://api.github.com/users/lz1irq/orgs","repos_url":"https://api.github.com/users/lz1irq/repos","events_url":"https://api.github.com/users/lz1irq/events{/privacy}","received_events_url":"https://api.github.com/users/lz1irq/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-03T09:13:12Z","updated_at":"2016-05-03T09:28:21Z","closed_at":"2016-05-03T09:20:42Z","body":"### Setup\r\nDebian 8 (Jessie) stable with python 2.7.9. I have `pyocclient 0.1` installed in a virtualenv via pip.\r\nOwnCloud is running on a CentOS7 machine under Apache. External requests and SSL are handled via a nginx reverse proxy, but I am using the local address (`192.168.122.121:2100`) to avoid any possible issues associated with nginx.\r\n\r\n### Issue\r\nThe code I am running is:\r\n```\r\nimport owncloud\r\nuser = 'username'\r\npassword = 'password'\r\n\r\nocl = owncloud.Client('http://192.168.122.121:2100')\r\nocl.login(username, password)\r\nocl.list('/')\r\n```\r\n\r\nWhen I do this, I get a `401 Not Authorized` error. From the OC admin panel logs:\r\n```\r\nException: {\"Message\":\"HTTP\\/1.1 401 No 'Authorization: Basic' header found. Either the client didn't \r\nsend one, or the server is mis-configured\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\r\n\\\\NotAuthenticated\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\r\n\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\/var\\\r\n/www\\/html\\/owncloud\\/3rdparty\\/sabre\\/event\\/lib\\/EventEmitterTrait.php(105):\r\n call_user_func_array(Array, Array)\\n#2 \\/var\\/www\\/html\\/owncloud\\/3rdparty\\/sabre\\/dav\\/lib\\/DAV\r\n\\/Server.php(446): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\/var\\/www\\/html\r\n\\/owncloud\\/3rdparty\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(248):\r\n Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\r\n\\\\Response))\\n#4 \\/var\\/www\\/html\\/owncloud\\/apps\\/dav\\/appinfo\\/v1\\/webdav.php(55): Sabre\\\\DAV\r\n\\\\Server->exec()\\n#5 \\/var\\/www\\/html\\/owncloud\\/remote.php(138): require_once('\\/var\\/www\\/html\\\r\n/o...')\\n#6 {main}\",\"File\":\"\\/var\\/www\\/html\\/owncloud\\/3rdparty\\/sabre\\/dav\\/lib\\/DAV\\/Auth\r\n\\/Plugin.php\",\"Line\":188,\"User\":\"ivo\"} \r\n```\r\n\r\n### Debugging\r\n\r\nI decided to listen in via wireshark. First, I ran the following request via curl:\r\n\r\n`curl -D - -X PROPFIND -k http://$username:$password@192.168.122.121:2100/remote.php/carddav`\r\n\r\nWhich resulted in this packet being sent:\r\n![basic auth package](https://i.imgur.com/GEl6Mby.png)\r\nand a `HTTP/1.1 200 OK` response.\r\n\r\nHowever, when I run the code above, it generates this package:\r\n![pyocclient](https://i.imgur.com/t7RhNOX.png)\r\nwhich leads to a `HTTP/1.1 401 Unauthorized` response.\r\n\r\nDesktop clients and web login work fine. I may be missing something really obvious, but I've bothered to write out a detailed report just in case.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/owncloud/pyocclient/issues/comments/216477826","html_url":"https://github.com/owncloud/pyocclient/issues/160#issuecomment-216477826","issue_url":"https://api.github.com/repos/owncloud/pyocclient/issues/160","id":216477826,"user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T09:28:21Z","updated_at":"2016-05-03T09:28:21Z","body":"Yeah... I hope to find time to do the 0.2 release one of these days..."}}