Last modified: 2010-02-14 17:35:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T23810, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21810 - Support Attribute Exchange
Support Attribute Exchange
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
OpenID (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Sergey Chernyshev
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-10 09:51 UTC by Craig Box
Modified: 2010-02-14 17:35 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Attribute Exchange support & autogeneration of username by e-mail address (optional) (8.05 KB, patch)
2009-12-10 14:47 UTC, Craig Box
Details
Version against trunk with further configuration enhancements (11.69 KB, patch)
2009-12-13 21:15 UTC, Craig Box
Details
New patch against latest trunk (13.15 KB, patch)
2010-02-09 16:04 UTC, Craig Box
Details
Fix AX patch (against r62444) (967 bytes, patch)
2010-02-13 17:05 UTC, Craig Box
Details

Description Craig Box 2009-12-10 09:51:32 UTC
The OpenID extension currently requests e-mail address by simple registration (SREG).  It should also attempt to request it by attribute exchange (AX), as this is supported by more providers (most importantly, Google.
Comment 1 Craig Box 2009-12-10 14:47:06 UTC
Created attachment 6866 [details]
Attribute Exchange support & autogeneration of username by e-mail address (optional)

Patch for the 1.15.1 line.

It also includes a new config option, $wgOpenIDUseEmailAsNickname, which will use the part before the @ as your e-mail address.  You should only use this if you are using a single OpenID provider, like Google Apps, where everyone is guaranteed to not have a conflict.
Comment 2 Sergey Chernyshev 2009-12-10 17:34:20 UTC
Looks great! Can you provide a patch for the latest trunk version?
http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/OpenID/
Comment 3 Brion Vibber 2009-12-10 17:54:52 UTC
Comment on attachment 6866 [details]
Attribute Exchange support & autogeneration of username by e-mail address (optional)

[tweaking attachment for inline view]
Comment 4 Craig Box 2009-12-13 21:15:24 UTC
Created attachment 6875 [details]
Version against trunk with further configuration enhancements

OK, this one is a bit of a monster (sorry) but adds the following:

* Attribute exchange to get full name and e-mail address (note: php-openid 2.0 in Debian Etch has a bug in its AX libraries; the version in Sid seems to be OK) 
* (configurably) Automatically using e-mail address user@ part as nickname
* (configurably) Hard-coding a single provider
Comment 5 Sergey Chernyshev 2009-12-15 17:09:44 UTC
Hmm. Applying this patch disabled OpenID menu item for mediawikiwidgets.org

Can you check if there is some version dependency in your code?
http://www.mediawikiwidgets.org/Special:Version
Comment 6 Craig Box 2009-12-15 17:26:35 UTC
I don't see the problem and didn't introduce anything serious in the code (nothing relating to that area either).  I was only testing on 1.15 though.
Comment 7 Craig Box 2010-02-09 16:04:52 UTC
Created attachment 7092 [details]
New patch against latest trunk

Here's a new patch against the current trunk (r62177).  It works well for me, and other patches I build will rely on it.

Now preferences have been backported, I can't see the error you referred to with the OpenID menu.  Can you test again, Sergey?
Comment 8 Sergey Chernyshev 2010-02-09 16:31:15 UTC
Yeah, I don't see any problems - it's possible that it I just missed some permission problems after patching last time.

What's the easiest way to test this new patch?
Comment 9 Craig Box 2010-02-09 16:33:35 UTC
Log into Google and see if you are prompted for e-mail address and real name, and check that they are set on your profile after you log in.
Comment 10 Sergey Chernyshev 2010-02-09 17:09:15 UTC
How do I know if it uses AX instead of SREG?
Comment 11 Craig Box 2010-02-09 17:37:44 UTC
Google doesn't do SREG.
Comment 12 Sergey Chernyshev 2010-02-09 18:32:09 UTC
I patched my test wiki and it doesn't seem to be grabbing AX data even though it is indeed requested and returned from Google.

http://wiki.sergeychernyshev.com/Main_Page

Logs report that data was properly returned from Google, but there are no errors in there and resulting form doesn't get populated with any data from AX.

Can you take a look and confirm that it doesn't work as intended?
Comment 13 Sergey Chernyshev 2010-02-12 18:09:15 UTC
Test wiki with this patch is moved here:
http://wiki.sergeychernyshev.com/test/index.php/Main_Page
Comment 14 Craig Box 2010-02-12 18:32:52 UTC
I logged in with my Gmail account, never having had an account on the wiki in the past, and according to http://wiki.sergeychernyshev.com/test/index.php/Special:Preferences, both my real name and my e-mail address are filled in, and a test e-mail to that address was generated.
Comment 15 Sergey Chernyshev 2010-02-12 19:46:23 UTC
Was the username suggested to you or you picked one yourself?
Comment 16 Craig Box 2010-02-12 19:50:17 UTC
I opted to go for my suggested name ("Craig Box"), but can test again with a generated name if you want?
Comment 17 Sergey Chernyshev 2010-02-12 21:02:21 UTC
That's the problem - it didn't suggest a name for me when I registered with my Google account.
Comment 18 Craig Box 2010-02-12 21:31:47 UTC
Previously, the name would have been taken from the 'fullname' attribute in SREG.

Now, AX is checked also:

                if ( array_key_exists( 'fullname', $sreg ) )
                        $fullname = $sreg['fullname'];
                 
                if ( array_key_exists( 'http://axschema.org/namePerson/first', $ax ) || array_key_exists( 'http://axschema.org/namePerson/last', $ax ) )
                        $fullname = $ax['http://axschema.org/namePerson/first'][0] . " " . $ax['http://axschema.org/namePerson/last'][0];

                if ( $fullname && $this->userNameOK( $fullname ) ) {
                        // offer the name

You therefore have to have either piece of the full name included, and the resulting concatenated string needs to be a valid username, for it to be offered to you.

If you don't have a valid real name set on your Google account, then you will not be offered the choice to use it.

Does this help?
Comment 19 Craig Box 2010-02-12 21:33:38 UTC
(Ahh, assuming your real name on Google is "Sergey Chernyshev", that user already exists on your wiki.)
Comment 20 Sergey Chernyshev 2010-02-12 21:36:45 UTC
Yeah, that might be a reason for this. Why didn't it suggest "Sergey Chernyshev2" or tell me, at least, that it already exists?

In any case, that's a separate question - this patch seems to be working then. I need to figure out how to test it in full though.
Comment 21 Craig Box 2010-02-12 21:39:59 UTC
Because it didn't do that before with only SREG. :)  If you choose your own name, and it already exists, you are silently returned to this page also.

For testing - I've been running with AX in production for some time now, and I'm pretty confident I've ironed out all the results.  It works great when given AX from someone like Google - I haven't tested with anyone who does SREG /and/ AX, but seeing as AX only does real name and e-mail address, I'm confident those cases are well covered.
Comment 22 Sergey Chernyshev 2010-02-12 22:29:19 UTC
OK, the only thing that I'm usually worrying about is contributors having special case and not catching other possible issue, that's the only reason I'm testing the code.

I'll go ahead and commit it. Thanks for contribution, BTW!
Comment 23 Sergey Chernyshev 2010-02-12 22:51:57 UTC
Added in r62390
Comment 24 Craig Box 2010-02-13 17:05:18 UTC
Created attachment 7116 [details]
Fix AX patch (against r62444)

There was an extraneous } in the checked in patch, and also a bug where it didn't check that the username it was going to automatically create an account for you, existed already.  Both are fixed in this patch.
Comment 25 Sergey Chernyshev 2010-02-13 21:26:33 UTC
Patch applied, please update and test.
Comment 26 Craig Box 2010-02-14 17:35:38 UTC
All good.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links