简体   繁体   English

SimpleSAMLphp IDP、SP、MediaWiki

[英]SimpleSAMLphp IDP, SP, MediaWiki

So, my next project.所以,我的下一个项目。 We have a custom made portal with an own user database.我们有一个带有自己的用户数据库的定制门户。 We wanted to use a Wiki, so I installed MediaWiki on a separate sub-domain.我们想使用 Wiki,所以我在一个单独的子域上安装了 MediaWiki。 Having multiple accounts is so 1990, therefor integration was wished.拥有多个帐户是 1990 年,因此希望整合。 That was not as easy as I hoped.那并不像我希望的那么容易。 Therefore, my solution was: Single Sign On.因此,我的解决方案是:单点登录。

IDP国内流离失所者

Step 1, installed SimpleSAMLphp as an IDP on the sub-domain sso.myportal.nu Created my own Module which looks up users in my database.第 1 步,在子域 sso.myportal.nu 上安装 SimpleSAMLphp 作为 IDP 创建我自己的模块,用于在我的数据库中查找用户。 Logging in to the SimpleSAMLphp admin portal, to test/verify if it works, looks great (screenshot attached).登录到 SimpleSAMLphp 管理门户,测试/验证它是否有效,看起来很棒(附上截图)。

SP SP

Step2, installed SimpleSAMLphp as an SP on the sub-domain wiki.myportal.nu Hooked the SP up to my IDP. Step2,在子域wiki.myportal.nu 上安装SimpleSAMLphp 作为SP 将SP 连接到我的IDP。 Logging in to the SimpleSAMLphp admin portal, to test/verify if it works, looks great.登录到 SimpleSAMLphp 管理门户,测试/验证它是否有效,看起来很棒。 I get authenticated through the IDP in my user database (screenshot attached).我通过用户数据库中的 IDP 进行身份验证(附上截图)。

MediaWiki媒体维基

Then installed two plugins into MediaWiki;然后在MediaWiki中安装了两个插件;

https://www.mediawiki.org/wiki/Extension:PluggableAuth https://www.mediawiki.org/wiki/Extension:SimpleSAMLphp https://www.mediawiki.org/wiki/Extension:PluggableAuth https://www.mediawiki.org/wiki/Extension:SimpleSAMLphp

That should enable SSO.那应该启用 SSO。

When clicking on the Login link in MediaWiki, I get redirected to the logon page of SimpleSAMLphp on sso.myportal.nu – so far so good.单击 MediaWiki 中的登录链接时,我被重定向到 sso.myportal.nu 上 SimpleSAMLphp 的登录页面——到目前为止一切顺利。 But, contrary to my expectations.. Logging in, does not work.但是,出乎我的意料......登录,不起作用。 It seems that I get redirected between sso.myportal.nu and wiki.myportal.nu似乎我在 sso.myportal.nu 和 wiki.myportal.nu 之间被重定向

I've enabled DEBUG mode, the only Warnings I see seem to be this:我启用了调试模式,我看到的唯一警告似乎是这样的:

Could not load state specified by InResponseTo: NOSTATE Processing response as unsolicited.

I have the config files and log files from both the SimpleSAMLphp installations attached below (a bit too much text to copy/paste here).我有来自下面附加的 SimpleSAMLphp 安装的配置文件和日志文件(在此处复制/粘贴的文本有点太多)。 config and log files After a day and a half looking through Google, I'm kind of stuck.配置和日志文件经过一天半的谷歌浏览后,我有点卡住了。 Anyone here any ideas?这里有人有任何想法吗?

Well, after two very long nights, the solution has been found .好吧,经过两个漫长的夜晚,找到了解决方案

First of all, if the " Test configured authentication sources " option on the " Authentication "-tab of your SimpleSAMLphp works... That is no guarantee that it will actually work.首先,如果 SimpleSAMLphp 的“身份验证”选项卡上的“测试配置的身份验证源”选项有效......这并不能保证它确实有效。

In my case, the IDP and SP were on the same server.就我而言,IDP 和 SP 在同一台服务器上。 Different sub-domains.不同的子域。 I had every setting in the config.php adjusted, so there were no settings the same for the IDP and SP (cookie names, passwords, etc, etc).我调整了 config.php 中的每个设置,因此 IDP 和 SP(cookie 名称、密码等)没有相同的设置。

The " Test configured authentication sources " option on the " Authentication "-tab of my SimpleSAMLphp worked!我的 SimpleSAMLphp 的“身份验证”选项卡上的“测试配置的身份验证源”选项起作用了! But MediaWiki still did not.但是 MediaWiki 仍然没有。

Apparently, this can also be caused by a mismatch of some settings in the config.php compared to php.ini显然,这也可能是由于 config.php 中的某些设置与 php.ini 不匹配造成的

I found a link to this page in an old Google Forum , where they mentioned the solution.我在一个旧的Google 论坛中找到了这个页面的链接,他们在那里提到了解决方案。 I could not believe it worked, but was desperate, so tried it.我不敢相信它起作用了,但很绝望,所以尝试了它。

The storage engine should be something else then the default.存储引擎应该是其他东西,然后是默认值。 In my case I connected SimpleSAMLphp to a MySQL database (can be sqlite, or anything else, as well).就我而言,我将 SimpleSAMLphp 连接到 MySQL 数据库(可以是 sqlite 或其他任何东西)。

'store.type'         => 'sql',
'store.sql.dsn'      => 'mysql:host=localhost;dbname=simplesamlStuff',
'store.sql.username' => 'simplesamlUser',
'store.sql.password' => '1234567980',
'store.sql.prefix'   => 'sso_',

Both the IDP and the SP can use the same database, as long as the prefix is different. IDP 和 SP 都可以使用相同的数据库,只要前缀不同即可。 It will create the tables it needs automatically, it just needs to know where to connect to which database with which credentials.它会自动创建它需要的表,它只需要知道从哪里使用什么凭据连接到哪个数据库。

The reason I'm not deleting my question, but answering myself... Is that I hope someone will find this post and find it helpful.我没有删除我的问题,而是回答自己的原因......是我希望有人会找到这篇文章并发现它有帮助。 Without spending so much time on this like myself.没有像我这样花太多时间在这上面。

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

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