Support attribute exchange to retrieve user details

Bug #517393 reported by James Henstridge
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
django-openid-auth
Fix Released
Medium
James Henstridge

Bug Description

We currently support the OpenID Simple Registration extension as a way to retrieve the user's name and email address from the OpenID provider for use when creating a new Django account.

Some high profile providers do not support sreg, but instead provide this data via the OpenID Attribute Exchange extension: the main one being Google.

Google provides some documentation about their provider at http://code.google.com/apis/accounts/docs/OpenID.html. The relevant attributes they provide are:
 * http://axschema.org/contact/email
 * http://axschema.org/namePerson/first
 * http://axschema.org/namePerson/last

Related branches

Changed in django-openid-auth:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Paul Tarjan (spam-paulisageek) wrote :

+1 These are the attributes supported by Yahoo as well http://developer.yahoo.net/blog/archives/2009/12/yahoo_openid_now_with_attribute_exchange.html

Is there a simple solution I can use in the meantime or is it a large patch?

Revision history for this message
James Henstridge (jamesh) wrote :

I've attached a branch to this bug that implements the feature. It doesn't require any additional configuration over trunk, and should work with any provider that advertises support for the Attribute Exchange extension in its XRDS.

I've done some basic testing against Google and Yahoo (who support slightly different sets of attributes), but would appreciate reports from any one else willing to test it.

Revision history for this message
James Henstridge (jamesh) wrote :

Fix merged in r66.

Changed in django-openid-auth:
assignee: nobody → James Henstridge (jamesh)
milestone: none → 0.3
status: Triaged → Fix Committed
Revision history for this message
Joe T (joe-topjian-v) wrote :

I've found that r66 prevents attributes from myopenid.com from being retrieved. It looks like the issue is with views.py.

I've attached a patch that should fix the problem. It enables attributes from myopenid.com to still be retrieved while still allowing attributes from Google to be retrieved as well. I have not tested this with any other OpenID providers.

Revision history for this message
Bjorn Meyer (bjorn-m-meyer) wrote :

I just grabbed the latest bzr release today as I was having an issue like one posted in the answers section about creating the accounts with the openiduser name instead of the actual user name. By the description, it sounded like this was corrected. However, I am still getting this as the account name but the user first and last name as well as the E-mail address are filled in correctly.
Am I missing something or is there still a bug on this?

I was testing against my Google account if that helps at all.

Revision history for this message
Joe T (joe-topjian-v) wrote :

Hi,

The username will default to "openiduser" if it does not find a value for the "nickname" attribute. From auth.py:

nickname = details['nickname'] or 'openiduser'

Hope that helps,
Joe

Revision history for this message
Bjorn Meyer (bjorn-m-meyer) wrote :

Thanks for the response Joe.

It helps me to a point I guess. It explains what's happening.

I guess Google doesn't send the nickname at all as I seem to only get the E-mail address and the first and last name.

Is there any reason that the first and last names aren't used for the account name if the nickname field is empty?

Bjorn

Revision history for this message
Joe T (joe-topjian-v) wrote :

I'm not sure of the reasoning behind defaulting to 'openiduser'. You could edit the auth.py file to change it to any combination of other attributes: first+last name, email, email substituting @ for ".", etc.

Revision history for this message
Bjorn Meyer (bjorn-m-meyer) wrote :

Thanks Joe, that put me on the right track.

Revision history for this message
Joe T (joe-topjian-v) wrote :

I forgot to change the status of this bug when I submitted my patch. I believe the fix submitted in r66 opens up a new bug and therefore does not completely fix this problem.

Changed in django-openid-auth:
status: Fix Committed → In Progress
Revision history for this message
James Henstridge (jamesh) wrote :

I've filed bug 607553 to track the problems with myOpenID. They appear to have based their implementation on a superseded draft specification and used different attribute names than everyone else. I'll make sure the 0.3 release includes a work around.

As for the username issue, please file a new bug if you'd like to see the behaviour changed. Comments on closed bug reports are liable to be lost.

Changed in django-openid-auth:
status: In Progress → Fix Committed
Changed in django-openid-auth:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.