Package: python-openid Version: 2.0.0-1 Severity: normal Tags: patch Hi,
I found two bugs in example server. I launch the server and client as described in the readme file of the example directory. I enter the id in the client which redirect to the server. The server ask for allow authentication but when I agree, it retruns a traceback : /tmp/server.py in addSRegResponse(self=<__main__.ServerHandler instance>, response=<openid.server.server.OpenIDResponse object>) 193 else: 194 response = self.server.openid.handleRequest(request) 195 self.displayResponse(response) 196 197 def addSRegResponse(self, response): 198 sreg_req = sreg.SRegRequest.fromOpenIDRequest(request.message) 199 200 # In a real application, this data would be user-specific, 201 # and the user should be asked for permission to release 202 # it. sreg_req undefined, global sreg = <module 'openid.sreg' from '/usr/lib/python2.4/site-packages/openid/sreg.pyc'>, sreg.SRegRequest = <class 'openid.sreg.SRegRequest'>, sreg.SRegRequest.fromOpenIDRequest = <bound method type.fromOpenIDRequest of <class 'openid.sreg.SRegRequest'>>, request undefined NameError: global name 'request' is not defined args = ("global name 'request' is not defined",) I correct it in path1. With my new server.py, I tried to use the option for remembering authentification but it has no effect. I correct it in path2. -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (990, 'unstable'), (500, 'testing'), (500, 'stable') Architecture: i386 (i686) Kernel: Linux 2.6.18-4-686 (SMP w/1 CPU core) Locale: LANG=fr_FR, LC_CTYPE=fr_FR (charmap=ISO-8859-1) Shell: /bin/sh linked to /bin/bash Versions of packages python-openid depends on: ii python 2.4.4-6 An interactive high-level object-o ii python-central 0.5.14 register and build utility for Pyt ii python-urljr 1.0.1-1 Common interface to urllib2 and cu ii python-yadis 1.1.0-1 Yadis service discovery library python-openid recommends no packages. -- no debconf information
--- server.py.old 2007-06-17 13:49:12.000000000 +0200 +++ server.py 2007-06-17 13:50:07.000000000 +0200 @@ -194,8 +194,8 @@ response = self.server.openid.handleRequest(request) self.displayResponse(response) - def addSRegResponse(self, response): - sreg_req = sreg.SRegRequest.fromOpenIDRequest(request.message) + def addSRegResponse(self, response, request): + sreg_req = sreg.SRegRequest.fromOpenIDRequest(request) # In a real application, this data would be user-specific, # and the user should be asked for permission to release @@ -209,7 +209,7 @@ def approved(self, request, identifier=None): response = request.answer(True, identity=identifier) - self.addSRegResponse(response) + self.addSRegResponse(response, request) return response def handleCheckIDRequest(self, request):
--- server.py.old 2007-06-17 13:52:41.000000000 +0200 +++ server.py 2007-06-17 13:53:31.000000000 +0200 @@ -170,7 +170,7 @@ if self.user is None: return False - if identity_url != self.server.base_url + self.user: + if identity_url != self.server.base_url + 'id/' + self.user: return False key = (identity_url, trust_root)