View Single Post
Old 11-18-2010, 08:54 AM   #1
myudkowsky
Enthusiast
myudkowsky began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
Question Login/Password for Calibre Server

I'd like to use Calibre server with WordPlay, etc. on my Android phone, but when I attempt to log in with my username and password, I get errors.

I've set the port, username, and password for Calibre Server using the preferences pane, but the login/password protection sometimes does not work, and sometimes prevents me from accessing the content.

In these examples, I use the command line tool to demonstrate the problem of setting calibre to require a username and password, and then being unable to log in to the server.

Code:
643 ~: calibre-server --version
calibre-server (calibre 0.7.18)
Now I try to start the server with username foo and password bar, then I attempt to log in using curl for simplicity's sake:

Code:
: curl --user foo --include http://localhost:8083
Enter host password for user 'foo':
HTTP/1.1 401 Unauthorized
Date: Thu, 18 Nov 2010 13:31:55 GMT
Content-Length: 1344
Content-Type: text/html
Www-Authenticate: Digest realm="Password to access your calibre library. Username is foo", nonce="c8c2b42f5a613eb2290a2a2921826d3c", algorithm="MD5", qop="auth"
Server: CherryPy/3.1.2
Error:

Code:
  File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 591, in respond
    self.hooks.run('on_start_resource')
  File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 98, in run
    hook()
  File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 58, in __call__
    return self.callback(**self.kwargs)
  File "/usr/lib/pymodules/python2.6/cherrypy/lib/auth.py", line 74, in digest_auth
    raise cherrypy.HTTPError(401, "You are not authorized to access that resource")
What's really odd is
Code:
: calibre-server --username foo --port 8083
I.e., no password set, still gives me

Code:
  File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 591, in respond
    self.hooks.run('on_start_resource')
  File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 98, in run
    hook()
  File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 58, in __call__
    return self.callback(**self.kwargs)
  File "/usr/lib/pymodules/python2.6/cherrypy/lib/auth.py", line 74, in digest_auth
    raise cherrypy.HTTPError(401, "You are not authorized to access that resource")
HTTPError: (401, 'You are not authorized to access that resource')
I find similar problems when I attempt to log in via a regular browser, e.g., via lynx or Firefox.

I also get the impression that from time to time, even when I require a username and password in the preferences, Calibre will let me through without one -- but that's a problem for a different day.

I installed Calibre from Debian unstable, and cherrypy is version 3.1.2-1l, also Debian unstable.
myudkowsky is offline   Reply With Quote