I'm currently making an attempt to wrap a Turbogears app in a simple
authentication layer using AuthKit, but I am running into a problem
that's got me stumped. Here's a snippet from my start-project.py:
def valid(environ, username, password):
return (username=='ryan' and password=='secret')
wrappedApp = middleware(
wsgiApp,
method='form',
cookie_secret='BigSecret',
catch='*',
users_valid=valid
)
# Start the wsgi server
server = CherryPyWSGIServer(('127.0.0.1', 8123), wrappedApp)
server.start()
As you can see, the authentication I've got here mimics one of the
most basic examples in the AuthKit manual, and attempts to perform
simple form authentication. As I start the server up, everything
appears to work correctly. I can open my browser and navigate to a
page and am presented with the default "Please Log In!" form. If I
enter details (correct or incorrect) and submit the form however, I
get nothing. Checking the console, I find that an error has occurred,
and this error is causing the rest of the script to stop execution,
resulting in a timeout. Here's the traceback that I receive in the
console:
Traceback (most recent call last):
File "c:\python24\lib\site-packages\CherryPy-2.2.1-py2.4.egg\cherrypy
\_cpwsgiserver.py", line 201, in run
request.start_response)
File "c:\documents and settings\rpetrello\desktop\authkit\authkit
\authenticate\auth_tkt.py", line 285, in __call__
return self.app(environ, cookie_setting_start_response)
File "c:\documents and settings\rpetrello\desktop\authkit\authkit
\authenticate\multi.py", line 52, in __call__
result = check()
File "c:\documents and settings\rpetrello\desktop\authkit\authkit
\authenticate\multi.py", line 41, in check
return binding(environ, start_response)
File "c:\documents and settings\rpetrello\desktop\authkit\authkit
\authenticate\form.py", line 47, in __call__
formvars = parse_formvars(environ, include_get_vars=False)
File "C:\Python24\lib\site-packages\paste-1.3-py2.4.egg\paste
\request.py", line 174, in parse_formvars
keep_blank_values=1)
File "C:\Python24\lib\cgi.py", line 528, in __init__
self.read_urlencoded()
File "C:\Python24\lib\cgi.py", line 633, in read_urlencoded
qs = self.fp.read(self.length)
File "C:\Python24\lib\socket.py", line 295, in read
data = self._sock.recv(recv_size)
timeout: timed out
I've attempted other forms of authentication provided by AuthKit (such
as basic HTTP and digest) and they work perfectly fine.
The AuthKit that I have is the latest development source from the SVN
trunk at authkit.org.
The Turbogears that I'm running is version 1.0.2.2.
Any help or insight is much appreciated!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---