简体   繁体   中英

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?

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:

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, ie 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM