Python-openid does not provide ax or sreg attributes

I was finally able to get python-openid for user authentication, but I cannot create sreg.SRegResponse or ax.FetchResponse as they are returned as None. This comes from a Google Apps account, and I try to follow the example from https://github.com/openid/python-openid/tree/master/examples/djopenid . I heard that the Google OpenID system can be a little scared and requires some settings, such as Get OpenID AX attributes from Google / Yahoo in Rails

    response = c.complete(request_args, return_to)

    sreg_response = sreg.SRegResponse.fromSuccessResponse(response)
    ax_response = ax.FetchResponse.fromSuccessResponse(response)

The answer is definitely returned as SUCCESS, but I see the following error message that may be related:

Generated checkid_setup request to https://www.google.com/accounts/o8/ud with assocication AOQobUdVBCrd-GZRcasn9tD-yOUF0Y8pJLAQrYXODqLxUUjN62G1BXR1
Error attempting to use stored discovery information: <openid.consumer.consumer.TypeURIMismatch: Required type http://specs.openid.net/auth/2.0/signon not found in ['http://specs.openid.net/auth/2.0/server', 'http://openid.net/srv/ax/1.0', 'http://specs.openid.net/extensions/ui/1.0/mode/popup', 'http://specs.openid.net/extensions/ui/1.0/icon', 'http://specs.openid.net/extensions/pape/1.0'] for endpoint <openid.consumer.discover.OpenIDServiceEndpoint server_url='https://www.google.com/accounts/o8/ud' claimed_id=None local_id=None canonicalID=None used_yadis=True >>
Attempting discovery to verify endpoint
Performing discovery on https://www.google.com/accounts/o8/id?id=AItOawkKU4uzJV9Q_FGMECNGsbiXG2caISYMyCw
Received id_res response from https://www.google.com/accounts/o8/ud using association AOQobUdVBCrd-GZRcasn9tD-yOUF0Y8pJLAQrYXODqLxUUjN62G1BXR1

Here is my setup.

           sreg_request = sreg.SRegRequest(optional=['email', 'nickname'],
                                        required=['dob'])
            auth_request.addExtension(sreg_request)

            # Add Attribute Exchange request information.
            ax_request = ax.FetchRequest()
            # XXX - uses myOpenID-compatible schema values, which are
            # not those listed at axschema.org.
            ax_request.add(ax.AttrInfo('http://schema.openid.net/namePerson',
                                       required=True))
            ax_request.add(ax.AttrInfo('http://schema.openid.net/contact/web/default',
                                       required=False, count=ax.UNLIMITED_VALUES))
            auth_request.addExtension(ax_request)
+3
source share
1

Google, schema.openid.net AttributeExchange. None , , , , OpenID.

axschema , . :

    URLS = {
      'ax_email': 'http://axschema.org/contact/email',
      'ax_first': 'http://axschema.org/namePerson/first',
    }

    ...

    ax_request = ax.FetchRequest()
    ax_request.add(ax.AttrInfo(URLS['ax_email'], required = True))
    ax_request.add(ax.AttrInfo(URLS['ax_first'], required = True))

    auth_request.addExtension(ax_request)
+4

All Articles