Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect Mediawiki to a custom user-database?

Sorry for the title, I can't find the right words for this. Let me explain what I want to do:

I have a Site, and a Wiki (latest Mediawiki). The Wiki is closed, so you need an account to read/write in the wiki. But when a user logs in into my site, he shall be automatically be logged in into the wiki when he comes there.

My first look into the mysql mediawiki user-table made me clueless: everything is saved as binary data, but in my user database it's plaintext, except the password of course.

I don't know how to proceed?

like image 201
iceteea Avatar asked Jun 29 '11 19:06

iceteea


People also ask

What port does MediaWiki use?

HTTP uses port 80 by default. One or another must be set up to use a different port, then both can be run but one on port 80 and the other on a different port (like port 81, 8080, etc).


2 Answers

You basically want to have two things:

  • One single account database on your website which is used from mediawiki, too.
  • Automatic login in mediawiki when the user logs on to your website

Central user database

Mediawiki has several extensions with connect the user management to a different database, for example:

  • AuthDrupal
  • AuthJoomla
  • LDAP
  • ExtAuthDB

You should have a look at ExtAuthDB, since it should be configurable enough for you.

Single Sign On

Single sign on (SSO) is mostly done by sharing a cookie between the web applications. To make this happen, you need to have the wiki in a subdomain of your main page, i.e. wiki.example.org when your website is at example.org.

On your website, set a cookie for .example.org (note the leading dot in the cookie domain), so it's available for wiki.example.org, too.

The cookies content's may either be a full-fledged mediawiki cookie (which you need to create on your website), or a cookie with the relevant user information that an own extension to the wiki reads and logs the user in. I suggest having a look how Phpbb_Single_Sign-On is implemented and do the same for your site.

like image 199
cweiske Avatar answered Oct 15 '22 01:10

cweiske


You can call MediaWiki API:Login on your site login routine and API:Logout on logout routine, provide the username and password used on your site and wiki are the same.

like image 41
alamaby Avatar answered Oct 15 '22 00:10

alamaby