{"action":"created","issue":{"url":"https://api.github.com/repos/koordinates/python-client/issues/14","labels_url":"https://api.github.com/repos/koordinates/python-client/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/koordinates/python-client/issues/14/comments","events_url":"https://api.github.com/repos/koordinates/python-client/issues/14/events","html_url":"https://github.com/koordinates/python-client/issues/14","id":113460725,"number":14,"title":"AuthenticationError","user":{"login":"josephramsay","id":1757695,"avatar_url":"https://avatars.githubusercontent.com/u/1757695?v=3","gravatar_id":"","url":"https://api.github.com/users/josephramsay","html_url":"https://github.com/josephramsay","followers_url":"https://api.github.com/users/josephramsay/followers","following_url":"https://api.github.com/users/josephramsay/following{/other_user}","gists_url":"https://api.github.com/users/josephramsay/gists{/gist_id}","starred_url":"https://api.github.com/users/josephramsay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephramsay/subscriptions","organizations_url":"https://api.github.com/users/josephramsay/orgs","repos_url":"https://api.github.com/users/josephramsay/repos","events_url":"https://api.github.com/users/josephramsay/events{/privacy}","received_events_url":"https://api.github.com/users/josephramsay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-26T22:02:17Z","updated_at":"2015-10-26T22:34:16Z","closed_at":null,"body":"Unable to authenticate using LDS API key.\r\n\r\nRunning the simple script\r\n\r\n```python\r\nimport koordinates\r\n\r\nlclient = koordinates.Client(host='data.linz.govt.nz', token='\\<linz-api-key\\>')\r\nprint lclient\r\n\r\nfor layer in lclient.layers.order_by('created_at')[:10]:\r\n   print(layer)\r\n\r\nfor layer in lclient.catalog.list().filter(license__type='cc').filter(type='layer').order_by('created_at'):\r\n        print(layer.title)\r\n```\r\n\r\nproduces the trace\r\n\r\n```\r\n<koordinates.client.Client object at 0x7f3d59eb3fd0>\r\nNo handlers could be found for logger \"koordinates.client\"\r\nTraceback (most recent call last):\r\n  File \"Test.py\", line 6, in <module>\r\n    for layer in lclient.layers.order_by('created_at')[:10]:\r\n  File \"/usr/local/lib/python2.7/dist-packages/koordinates/base.py\", line 216, in __getitem__\r\n    return list(itertools.islice(self.__iter__(), k.stop))\r\n  File \"/usr/local/lib/python2.7/dist-packages/koordinates/base.py\", line 170, in __iter__\r\n    r = self._request(url)\r\n  File \"/usr/local/lib/python2.7/dist-packages/koordinates/base.py\", line 115, in _request\r\n    r = self._manager.client.request(method, url, headers=self._to_headers())\r\n  File \"/usr/local/lib/python2.7/dist-packages/koordinates/client.py\", line 112, in request\r\n    r = self._raw_request(method, url, headers, *args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/koordinates/client.py\", line 143, in _raw_request\r\n    raise exceptions.ServerError.from_requests_error(e)\r\nkoordinates.exceptions.AuthenticationError: 401 Client Error: UNAUTHORIZED\r\n```"},"comment":{"url":"https://api.github.com/repos/koordinates/python-client/issues/comments/151304158","html_url":"https://github.com/koordinates/python-client/issues/14#issuecomment-151304158","issue_url":"https://api.github.com/repos/koordinates/python-client/issues/14","id":151304158,"user":{"login":"josephramsay","id":1757695,"avatar_url":"https://avatars.githubusercontent.com/u/1757695?v=3","gravatar_id":"","url":"https://api.github.com/users/josephramsay","html_url":"https://github.com/josephramsay","followers_url":"https://api.github.com/users/josephramsay/followers","following_url":"https://api.github.com/users/josephramsay/following{/other_user}","gists_url":"https://api.github.com/users/josephramsay/gists{/gist_id}","starred_url":"https://api.github.com/users/josephramsay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephramsay/subscriptions","organizations_url":"https://api.github.com/users/josephramsay/orgs","repos_url":"https://api.github.com/users/josephramsay/repos","events_url":"https://api.github.com/users/josephramsay/events{/privacy}","received_events_url":"https://api.github.com/users/josephramsay/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T22:34:16Z","updated_at":"2015-10-26T22:34:16Z","body":"Hi Hamish, \r\nNo 0Auth-Scopes that I can see\r\n>>> k=koordinates.Client(host='data.linz.govt.nz', token='\\<linz-api-key\\>')\r\n>>> r=k.request('POST','http://data.linz.govt.nz')\r\n<Response [200]>\r\n>>> r.headers\r\n{'content-language': 'en-GB', 'content-encoding': 'gzip', 'transfer-encoding': 'chunked', 'set-cookie': 'csrftoken=LxSTkU6BePS0egAGQn8I5FKJEVscFLKZ; expires=Mon, 24-Oct-2016 22:25:54 GMT; Max-Age=31449600; Path=/; secure', 'vary': 'Accept-Encoding, Cookie,Accept-Language,Accept-Encoding, User-Agent', 'server': 'Koordinates', 'x-k-gentime': '0.908', 'connection': 'keep-alive', 'date': 'Mon, 26 Oct 2015 22:25:54 GMT', 'content-type': 'text/html; charset=utf-8'}\r\n"}}