简体   繁体   English

如何将 Mediawiki 连接到自定义用户数据库?

[英]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).我有一个站点和一个 Wiki(最新的 Mediawiki)。 The Wiki is closed, so you need an account to read/write in the wiki. Wiki 已关闭,因此您需要一个帐户才能在 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.我第一次查看 mysql mediawiki 用户表让我一无所知:所有内容都保存为二进制数据,但在我的用户数据库中,它是明文,当然除了密码。

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.您网站上的一个单一帐户数据库也可从 mediawiki 使用。
  • Automatic login in mediawiki when the user logs on to your website当用户登录您的网站时自动登录 mediawiki

Central user database中央用户数据库

Mediawiki has several extensions with connect the user management to a different database, for example: Mediawiki 有几个扩展,可以将用户管理连接到不同的数据库,例如:

You should have a look at ExtAuthDB, since it should be configurable enough for you.你应该看看 ExtAuthDB,因为它应该对你来说足够可配置。

Single Sign On单点登录

Single sign on (SSO) is mostly done by sharing a cookie between the web applications.单点登录 (SSO) 主要通过在 web 应用程序之间共享 cookie 来完成。 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 .要做到这一点,您需要在主页的子域中拥有 wiki,即当您的网站位于example.orgwiki.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.在您的网站上,为.example.org设置一个 cookie(注意 cookie 域中的前导点),因此它也可用于wiki.example.org

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. cookies 内容可能是一个成熟的 mediawiki cookie(您需要在您的网站上创建),或者是一个包含相关用户信息的 cookie,wiki 自己的扩展读取并登录用户。我建议看看如何实现Phpbb_Single_Sign-On并为您的网站做同样的事情。

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.您可以调用 MediaWiki API:Login on your site login routine 和API:Logout on logout routine,提供在您的站点和 wiki 上使用的用户名和密码相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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