Last modified: 2013-05-07 07:13:04 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 T41462, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39462 - [SUGGESTION] E:OpenID and separate mediawiki installations with shared user database
[SUGGESTION] E:OpenID and separate mediawiki installations with shared user d...
Status: ASSIGNED
Product: MediaWiki extensions
Classification: Unclassified
OpenID (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: T. Gries
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-17 19:09 UTC by simone.hinterseher
Modified: 2013-05-07 07:13 UTC (History)
1 user (show)

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


Attachments

Description simone.hinterseher 2012-08-17 19:09:12 UTC
I have two mediawiki installations (I want to use one for public content and one for private content that cannot be read by anyone).

However, for both wikis I like to use the same user table. Therefore I use 
$wgSharedDB = 'thePublicWikiDB' in the LocalSettings of the private wiki and close registration for the public wiki once all wanted users have registered. The OpenID extension is installed for both wikis.

The actual problem that I encountered with this setup and the OpenID extension:
The login works for the public wiki but not for the private wiki (which uses the user table of the other wiki). Is the OpenID extension not built for such a case?
Do I have to configure something such that OpenID is aware of the shared user table?
Comment 1 simone.hinterseher 2012-08-17 19:26:29 UTC
Below are the versions I use:
OpenID (Version 1.004 20120427)
MediaWiki    1.19.1
PHP    5.3.3 (apache2handler)
MySQL    5.0.95
Comment 2 T. Gries 2012-08-17 21:41:38 UTC
I have never implemented shared wikis with a single user table. What is your OpenID Provider, a problem is known for Google, as Google OpenIDs are distinct for different RP. So this might cause your problem.

Try to use a different OpenID provider for the second wiki entry. I suggest you use Verisign https://pip.verisignlabs.com (or Yahoo), which you then connect with the same user in your wiki.

Or try this:
+ login with your OpenID to your first wiki. (you said, it works)
+ open a new tab and LOG OUT your OpenID identity on the provider (you will stay logged in to your wiki as this has set you a user account cookie, as you know)
+ close the OpenID provider tab (where you just logged out)
+ open a new tab, and navigate to your second wiki (you are not yet logged in there)
+ start login sequence to your second wiki

Does it work ?

General advice when testing OpenID extension:
=============================================

+ always fully fully out from ALL OpenID providers, close their windows.
+ Delete all cookies and session history in your browser. (You do not have to clear passwords).
+ once a new OpenID authentication is triggered, it will start new login sequences.



This is always a goog starting point for testing.
Comment 3 T. Gries 2012-08-17 21:42:09 UTC
-
Comment 4 T. Gries 2012-08-17 21:42:33 UTC
s/goog/good/
Comment 5 T. Gries 2012-08-17 21:43:50 UTC
by the way, I suggest to run MediaWiki "master" from git
Comment 6 simone.hinterseher 2012-08-18 04:09:36 UTC
> Or try this:
> + login with your OpenID to your first wiki. (you said, it works)
> + open a new tab and LOG OUT your OpenID identity on the provider (you will
> stay logged in to your wiki as this has set you a user account cookie, as you
> know)
> + close the OpenID provider tab (where you just logged out)
> + open a new tab, and navigate to your second wiki (you are not yet logged in
> there)
> + start login sequence to your second wiki
>
> Does it work ?

That works because both wikis are on the same domain and I have the $wgCookieDomain set accordingly. I don't even have to start the login sequence on the second wiki. The problem still persists when a user wants to login on the second wiki before visiting the first wiki.
Comment 7 simone.hinterseher 2012-08-18 05:40:53 UTC
I worked around the problem by changing the second wiki as follows: 
- Adapted MediaWiki:Loginreqpagetext to link to the login of the first wiki with returnto parameter back to second wiki
- Removing the login button in the top for the second wiki as described here:
http://www.mediawiki.org/wiki/Manual:FAQ#How_do_I_remove_the_.22Create_an_Account_or_Login.22_link_at_the_top_right_of_the_screen.3F

Tried to adapt the variables $personal_urls['anonlogin'], personal_urls['createaccount'] of the example code to reflect the login of the first wiki with return to the second wiki. 
$personal_urls['anonlogin'] = 'link';
Couldn't figure out how to do it.

Assuming that no other login links exist, with this workaround I hope the problem is sufficiently dealt with. If you know that this might cause other problems please let me know.

Thanks for your great help!
Comment 8 T. Gries 2012-08-18 08:31:01 UTC
Do I understand correctly, that with the mentioned changes your problem is solved, and that it can be closed as resolved (then pls. close).
Comment 9 Daniel Friesen 2012-08-18 08:44:19 UTC
So you have shared users but you can't log in with openid on the other wiki.

Sounds like you never added the table the openid extension stores openids in to $wgSharedTables so it's only accessible from one wiki.
Comment 10 T. Gries 2012-08-18 14:27:10 UTC
(In reply to comment #9)
> So you have shared users but you can't log in with openid on the other wiki.
> 
> Sounds like you never added the table the openid extension stores openids in to
> $wgSharedTables so it's only accessible from one wiki.

Good idea, and a good hint. Yes, this may be the problem.

Question to experts of shared wiki installation:

In shared wiki installations, shouldn't the user_openid table be also shared ? If the user table is share, the OpenID must also be shared (as far as I understand, I may be wrong. As mentioned above, I am not an expert in shared-wikis. Never installed some).

Updating:

php $IP/maintenance/update.php --help

shows you the options to update the first and the second wiki database

Here is what I always use when updating:

php update.php --dbuser <dbrootusername> --dbpass <dbrootpassword> --conf <path -to-localsettings-of-each-of first-or-second-wiki.php
Comment 11 simone.hinterseher 2012-08-21 06:01:42 UTC
Thanks for the hint. Tried it like this, did however not solve the issue.

$wgSharedDB = 'db_of_first_wiki';
$wgSharedTables = array("user", "user_groups", "user_openid");

Also running a php update.php didn't help.
Comment 12 T. Gries 2013-05-07 07:12:28 UTC
@ Simone:
Can this be closed ?

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


Navigation
Links