Commits

Anonymous committed 41dc0f8

various fixes, will clean later

Comments (0)

Files changed (2)

oidserver/controllers.py

         res = template.render(user=user)
         return Response(str(res), content_type='application/xrds+xml')
 
-    def index(self, request):
+    def index(self, request, **params):
         # XXX see why _ / .
-        params = dict([(key.replace('.', '_'), str(value))
-                        for key, value in request.POST.items()])
-
+        if request.method == 'POST':
+	        params = dict([(key.replace('.', '_'), str(value))
+        	                for key, value in request.POST.items()])
+        else:
+            for key, value in list(params.items()):
+                if '.' in key:
+                    params[key.replace('.', '_')] = value
+                    del params[key]            
+  
         if 'openid_mode' not in params:
             raise HTTPBadRequest('Missing "openid_mode"')
 
 
         if root is not None:
             message.append('trust_root:%s\n' % root)
-        message = ''.join(message)
+        message = str(''.join(message))
         try:
             mac_key = self.app.storage.get_secret(handle)
         except KeyError:
             mac_key = handle
-        hash = hmac.new(mac_key, message, hashlib.sha1)
+        hash = hmac.new(str(mac_key), message, hashlib.sha1)
         return b64encode(hash.digest())

oidserver/wsgiapp.py

 from oidserver.storage import OIDStorage
 
 urls = [('POST', '/', 'oid', 'index', False),
+        ('GET', '/', 'oid', 'index', False),
         ('GET', '/{user:[a-zA-Z0-9._-]+}', 'oid', 'get_yadis', False)]