~mhall119/django-openid-auth/strict-username-requirements

« back to all changes in this revision

Viewing changes to django_openid_auth/auth.py

myOpenID's attribute exchange implementation uses non-standard attribute 
names from an old draft of the specification.  Ask for these attributes 
in addition to the standard ones to support that provider.

Fixes bug #607553.

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
        # them in preference.
103
103
        fetch_response = ax.FetchResponse.fromSuccessResponse(openid_response)
104
104
        if fetch_response:
 
105
            # The myOpenID provider advertises AX support, but uses
 
106
            # attribute names from an obsolete draft of the
 
107
            # specification.  We check for them first so the common
 
108
            # names take precedence.
 
109
            email = fetch_response.getSingle(
 
110
                'http://schema.openid.net/contact/email', email)
 
111
            fullname = fetch_response.getSingle(
 
112
                'http://schema.openid.net/namePerson', fullname)
 
113
            nickname = fetch_response.getSingle(
 
114
                'http://schema.openid.net/namePerson/friendly', nickname)
 
115
 
105
116
            email = fetch_response.getSingle(
106
117
                'http://axschema.org/contact/email', email)
107
118
            fullname = fetch_response.getSingle(