Problem with response which contains both signed and unsigned fields #16

MarSoft opened this Issue Jun 21, 2011 · 0 comments

1 participant


When my OpenID provider gives me response containing both signed and unsigned fields, I get an error:

SuccessResponse.getSignedNS: (, mode) not signed.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/flask/", line 889, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/lib/python2.7/site-packages/flask/", line 879, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/lib/python2.7/site-packages/flask/", line 876, in wsgi_app
    rv = self.dispatch_request()
  File "/usr/lib/python2.7/site-packages/flask/", line 695, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python2.7/site-packages/flaskext/", line 416, in decorated
    return self.after_login_func(OpenIDResponse(openid_response))
  File "/usr/lib/python2.7/site-packages/flaskext/", line 151, in __init__
    lookup = RegLookup(resp)
  File "/usr/lib/python2.7/site-packages/flaskext/", line 112, in __init__
    self.ax_resp = ax.FetchResponse.fromSuccessResponse(resp) or {}
  File "/usr/lib/python2.7/site-packages/openid/extensions/", line 711, in fromSuccessResponse
  File "/usr/lib/python2.7/site-packages/openid/extensions/", line 686, in parseExtensionArgs
    super(FetchResponse, self).parseExtensionArgs(ax_args)
  File "/usr/lib/python2.7/site-packages/openid/extensions/", line 498, in parseExtensionArgs
  File "/usr/lib/python2.7/site-packages/openid/extensions/", line 80, in _checkMode
    mode = ax_args.get('mode')
AttributeError: 'NoneType' object has no attribute 'get'

From code and comments:

 @param signed: Whether non-signed args should be
            processsed. If True (the default), only signed arguments
            will be processsed.
ax_args = success_response.extensionResponse(self.ns_uri, signed)

in openid.consumer.consumer.SuccessResponse.extensionResponse(self, namespace_uri, require_signed):

 @param require_signed: True if the arguments should be among
        those signed in the response, False if you don't care.

        If require_signed is True and the arguments are not signed,
        return None.

As we can see, FetchResponse.fromSuccessfulResponse() expects success_response.extensionResponse to return a dictionary containing signed fields only, but gets a None.
How can it be fixed?..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment