How to connect Mediawiki to a user database?

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

I have a website and a Wiki (latest version of Mediawiki). Wikis are closed, so you need an account to read / write to the wiki. But when a user enters my site, he should be automatically registered on the wiki when he arrives there.

My first look at the mysql mediawiki user table made me dumb: everything is saved as binary data, but in my user database it is plain text, except for the password, of course.

I do not know how to act?

+6
source share
2 answers

Basically you want to have two things:

  • One single account on your website that is also used by MediaWiki.
  • Automatically login to mediawiki when a user logs in to your website.

Central user database

Mediawiki has several extensions with connecting user management to another database, for example:

You should take a look at ExtAuthDB, as it should be enough for you.

Single sign-on

Single Sign-On (SSO) is mainly done through the sharing of cookies between web applications. For this to happen, you need to have a wiki in the subdomain of your main page, i.e. wiki.example.org when your site is in example.org .

Set a cookie for .example.org on your website (note the leading point in the cookie domain), so it is also available for wiki.example.org .

The content of the cookie can be either a full mediawiki file (which you need to create on your website) or a cookie with the relevant user information that the wiki extension itself reads and logs in. I suggest looking at how Phpbb_Single_Sign-On is implemented and does the same for your site.

+9
source

You can call the MediaWiki API: Log in to your site registration system and API: Log out , enter the username and password used on your site, and the wiki are the same.

+2
source

Source: https://habr.com/ru/post/891673/


All Articles