News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Linking SMF with MediaWiki

Started by Senkusha, April 03, 2025, 09:19:43 PM

Previous topic - Next topic

Senkusha

I know much has changed over the years, and I've followed the gitHub resource for linking SMF (2.1.4) with MediaWiki (as soon as I figure out how/what the current version I have installed is...)

Anyway, Is this still a thing, this Bridge?  I followed the directions, and I must have something messed up somewhere.

When I enable the extension, I get the following:
MediaWiki internal error.

Original exception: [Z-8sbPdftexxJ6Nrbfku9AAIKAA] /index.php?title=Main_Page TypeError: MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::__construct(): Argument #1 ($loadBalancer) must be of type Wikimedia\Rdbms\ILoadBalancer, Wikimedia\Rdbms\LBFactorySimple given, called in /home/animerpgs/www/wiki/extensions/ForumSsoProvider/ForumAuthManager.php on line 36
Backtrace:
from /home/animerpgs/www/wiki/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php(74)
#0 /home/animerpgs/www/wiki/extensions/ForumSsoProvider/ForumAuthManager.php(36): MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider->__construct(Wikimedia\Rdbms\LBFactorySimple, MediaWiki\User\UserOptionsManager, array)
#1 /home/animerpgs/www/wiki/vendor/wikimedia/object-factory/src/ObjectFactory.php(240): ForumAuthManager->__construct()
#2 /home/animerpgs/www/wiki/vendor/wikimedia/object-factory/src/ObjectFactory.php(149): Wikimedia\ObjectFactory\ObjectFactory::getObjectFromSpec(array, array)
#3 /home/animerpgs/www/wiki/includes/auth/AuthManager.php(2482): Wikimedia\ObjectFactory\ObjectFactory->createObject(array, array)
#4 /home/animerpgs/www/wiki/includes/auth/AuthManager.php(2528): MediaWiki\Auth\AuthManager->providerArrayFromSpecs(string, array)
#5 /home/animerpgs/www/wiki/includes/auth/AuthManager.php(1026): MediaWiki\Auth\AuthManager->getPrimaryAuthenticationProviders()
#6 /home/animerpgs/www/wiki/includes/skins/SkinTemplate.php(582): MediaWiki\Auth\AuthManager->canCreateAccounts()
#7 /home/animerpgs/www/wiki/includes/skins/SkinTemplate.php(512): SkinTemplate->useCombinedLoginLink()
#8 /home/animerpgs/www/wiki/includes/skins/SkinTemplate.php(1071): SkinTemplate->buildPersonalUrls(boolean)
#9 /home/animerpgs/www/wiki/includes/skins/SkinTemplate.php(651): SkinTemplate->buildContentNavigationUrlsInternal()
#10 /home/animerpgs/www/wiki/includes/skins/SkinTemplate.php(188): SkinTemplate->getPortletsTemplateData()
#11 /home/animerpgs/www/wiki/includes/skins/SkinMustache.php(92): SkinTemplate->getTemplateData()
#12 /home/animerpgs/www/wiki/skins/Vector/includes/SkinVectorLegacy.php(161): SkinMustache->getTemplateData()
#13 /home/animerpgs/www/wiki/includes/skins/SkinMustache.php(62): MediaWiki\Skins\Vector\SkinVectorLegacy->getTemplateData()
#14 /home/animerpgs/www/wiki/includes/skins/SkinTemplate.php(181): SkinMustache->generateHTML()
#15 /home/animerpgs/www/wiki/includes/OutputPage.php(2899): SkinTemplate->outputPage()
#16 /home/animerpgs/www/wiki/includes/MediaWiki.php(941): OutputPage->output(boolean)
#17 /home/animerpgs/www/wiki/includes/MediaWiki.php(576): MediaWiki->main()
#18 /home/animerpgs/www/wiki/index.php(50): MediaWiki->run()
#19 /home/animerpgs/www/wiki/index.php(46): wfIndexMain()
#20 {main}

Exception caught inside exception handler: [Z-8sbPdftexxJ6Nrbfku9AAIKAA] /index.php?title=Main_Page RuntimeException: Duplicate specifications for id MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider (classes MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider and MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider)
Backtrace:
from /home/animerpgs/www/wiki/includes/auth/AuthManager.php(2486)
#0 /home/animerpgs/www/wiki/includes/auth/AuthManager.php(2528): MediaWiki\Auth\AuthManager->providerArrayFromSpecs(string, array)
#1 /home/animerpgs/www/wiki/includes/auth/AuthManager.php(1026): MediaWiki\Auth\AuthManager->getPrimaryAuthenticationProviders()
#2 /home/animerpgs/www/wiki/includes/skins/SkinTemplate.php(582): MediaWiki\Auth\AuthManager->canCreateAccounts()
#3 /home/animerpgs/www/wiki/includes/skins/SkinTemplate.php(512): SkinTemplate->useCombinedLoginLink()
#4 /home/animerpgs/www/wiki/includes/skins/SkinTemplate.php(1071): SkinTemplate->buildPersonalUrls(boolean)
#5 /home/animerpgs/www/wiki/includes/skins/SkinTemplate.php(651): SkinTemplate->buildContentNavigationUrlsInternal()
#6 /home/animerpgs/www/wiki/includes/skins/SkinTemplate.php(188): SkinTemplate->getPortletsTemplateData()
#7 /home/animerpgs/www/wiki/includes/skins/SkinMustache.php(92): SkinTemplate->getTemplateData()
#8 /home/animerpgs/www/wiki/skins/Vector/includes/SkinVectorLegacy.php(161): SkinMustache->getTemplateData()
#9 /home/animerpgs/www/wiki/includes/skins/SkinMustache.php(62): MediaWiki\Skins\Vector\SkinVectorLegacy->getTemplateData()
#10 /home/animerpgs/www/wiki/includes/skins/SkinTemplate.php(181): SkinMustache->generateHTML()
#11 /home/animerpgs/www/wiki/includes/OutputPage.php(2899): SkinTemplate->outputPage()
#12 /home/animerpgs/www/wiki/includes/exception/MWExceptionRenderer.php(184): OutputPage->output()
#13 /home/animerpgs/www/wiki/includes/exception/MWExceptionRenderer.php(103): MWExceptionRenderer::reportHTML(TypeError)
#14 /home/animerpgs/www/wiki/includes/exception/MWExceptionHandler.php(132): MWExceptionRenderer::output(TypeError, integer)
#15 /home/animerpgs/www/wiki/includes/exception/MWExceptionHandler.php(249): MWExceptionHandler::report(TypeError)
#16 /home/animerpgs/www/wiki/includes/MediaWiki.php(598): MWExceptionHandler::handleException(TypeError, string)
#17 /home/animerpgs/www/wiki/index.php(50): MediaWiki->run()
#18 /home/animerpgs/www/wiki/index.php(46): wfIndexMain()
#19 {main}

My LocalSettings file has the following added:
# SMF Bridge Configuration
$wgFSPPath = '/home/animerpgs/www/forum/';
$wgFSPSoftware = 'smf2.1';
#$wgFSPAllowGroups = array(5);
$wgFSPDenyGroups = array(4);
$wgFSPAdminGroups = array(1, 2);
$wgFSPSuperGroups = array(1);
$wgFSPInterfaceGroups = array(1);
$wgFSPSpecialGroups = array(
11 => 'Custom_Wiki_group',
);
$wgFSPEnableBanCheck = true;
$wgGroupPermissions['*']['createaccount']    = false;
$wgGroupPermissions['*']['read']              = true;
$wgGroupPermissions['*']['edit']              = false;
$wgGroupPermissions['*']['createtalk']        = false;
$wgGroupPermissions['*']['createpage']        = false;
$wgGroupPermissions['*']['writeapi']          = false;
$wgGroupPermissions['user']['move']          = true;
$wgGroupPermissions['user']['read']          = true;
$wgGroupPermissions['user']['edit']          = true;
$wgGroupPermissions['user']['upload']        = true;
$wgGroupPermissions['user']['autoconfirmed']  = true;
$wgGroupPermissions['user']['emailconfirmed'] = true;
$wgGroupPermissions['user']['createtalk']    = true;
$wgGroupPermissions['user']['createpage']    = true;
$wgGroupPermissions['user']['writeapi']      = true;

# Legacy SMF Auth Settings?
define('SMF_IN_WIKI', true);
$wgSMFLogin = true;
$wgSMFGroupID = array(2);
$wgSMFDenyGroupID = array(4);
$wgSMFAdminGroupID = array(1, 2);
$wgSMFSpecialGroups = array(
11 => 'Custom_Wiki_group',
);
$wgCookieDomain = 'animerpgs.com';

# SMF Bridge Troubleshooting
$wgDebugLogFile = "/home/animerpgs/www/wiki/logs/MediaWiki.log";
$wgShowExceptionDetails = true;
$wgShowSQLErrors = true;
$wgDebugDumpSql  = true;
$wgShowDBErrorBacktrace = true;

The very last line is the Bridge:
# End of automatically generated settings.
# Add more configuration options below.
wfLoadExtension( 'ForumSsoProvider' );

I had to manually create a directory named /extensions/ForumSsoProvider.  And I uploaded the entire contents of the .zip file to it.  Some things about my setup:
  • My forum is located on a subdomain:  /forum/
  • My wiki is located on a subdomain: /wiki/
  • My SMF and WIKI are not using the same databases.
I don't know if that makes any difference or not, but I figured I'd include it.

Has anybody encountered this before?
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

Oldiesmann

Michael Eshom
Christian Metal Fans

SleePy

What version of mediawiki is this?  I suspect its 1.41 or higher?  I haven't tested the newer mediawiki in a while.  But there was a issue reported against 1.41 that was fixed with the exact same error: https://github.com/SimpleMachines/smf-mw-auth/issues/27
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Senkusha

#3
It appears that it's 1.40.1, going by the zip file in my downloads folder from 12/20/2023.  I'm not sure if there's a way to tell within the Wiki software itself what the version is.

I'm upgrading to 1.43 now.  Thank you for pointing this out. :)
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

live627

Quote from: Senkusha on April 05, 2025, 07:05:41 PMI'm not sure if there's a way to tell within the Wiki software itself what the version is.
Special pages under Data and tools is a link to Versions

Senkusha

I've finally been able to upgrade to MW 1.4.3.  I've enabled the same bits as above in my config file, but when I attempt to login two things happen.  First, I get notified that I'm entering a Non-secure HTTP site (despite already adding the following to my config file.  Maybe this is a MediaWiki issue?
$wgForceHTTPS = true;

The second problem is that whenever I click "Log In", I'm not presented any dialog to log in or anything.  Also, I'm assuming I need to create a custom group "Wiki Editor" and change the array element from '11' to whatever the group number is for that group?

# SMF Bridge Configuration
$wgFSPPath = '/home/animerpgs/www/forum/';
$wgFSPSoftware = 'smf2.1';
$wgFSPAllowGroups = array(5);
$wgFSPDenyGroups = array(4);
$wgFSPAdminGroups = array(1, 2);
$wgFSPSuperGroups = array(1);
$wgFSPInterfaceGroups = array(1);
$wgFSPSpecialGroups = array(
11 => 'Custom_Wiki_group',
);
$wgFSPEnableBanCheck = true;
$wgGroupPermissions['*']['createaccount']    = false;
$wgGroupPermissions['*']['read']              = true;
$wgGroupPermissions['*']['edit']              = false;
$wgGroupPermissions['*']['createtalk']        = false;
$wgGroupPermissions['*']['createpage']        = false;
$wgGroupPermissions['*']['writeapi']          = false;
$wgGroupPermissions['user']['move']          = true;
$wgGroupPermissions['user']['read']          = true;
$wgGroupPermissions['user']['edit']          = true;
$wgGroupPermissions['user']['upload']        = true;
$wgGroupPermissions['user']['autoconfirmed']  = true;
$wgGroupPermissions['user']['emailconfirmed'] = true;
$wgGroupPermissions['user']['createtalk']    = true;
$wgGroupPermissions['user']['createpage']    = true;
$wgGroupPermissions['user']['writeapi']      = true;

# Legacy SMF Auth Settings?
#define('SMF_IN_WIKI', true);
#$wgSMFLogin = true;
#$wgSMFGroupID = array(2);
#$wgSMFDenyGroupID = array(4);
#$wgSMFAdminGroupID = array(1, 2);
#$wgSMFSpecialGroups = array(
# 11 => 'Custom_Wiki_group',
#);
#$wgCookieDomain = 'animerpgs.com';
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

Senkusha

Sorry for the double post.  I guess I waited to long to find this in the error log:

QuoteHTTP HEADERS:
HOST: wiki.animerpgs.com
TE: trailers
PRIORITY: u=0, i
IF-MODIFIED-SINCE: Thu, 10 Apr 2025 17:20:45 GMT
SEC-FETCH-USER: ?1
SEC-FETCH-SITE: same-origin
SEC-FETCH-MODE: navigate
SEC-FETCH-DEST: document
UPGRADE-INSECURE-REQUESTS: 1
COOKIE: mw_installer_session=188545fff2d7c02c63d446b94c2904e1; VEE=wikitext; animerpgs_wiki_session=eit9eeb5k3o1bvt9i2mv1pmlfca3i8ps
REFERER: https://wiki.animerpgs.com/index.php?title=Main%20Page&board=redirect
SEC-GPC: 1
DNT: 1
ACCEPT-ENCODING: gzip, deflate, br, zstd
ACCEPT-LANGUAGE: en-US,en;q=0.5
ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
USER-AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:137.0) Gecko/20100101 Firefox/137.0
(end headers)
[session] SessionManager using store SqlBagOStuff
[localisation] LocalisationCache using store LCStoreDB
[objectcache] MainWANObjectCache using store Wikimedia\ObjectCache\EmptyBagOStuff
[ForumSessionProvider] Constructor initialized.
[ForumSessionProvider] Loading Forum System Settings.
[ForumSessionProvider] Found Configuration File, attempting to loading.
[ForumSessionProvider] Loading the cookie using provider: smf2.1
[ForumSessionProvider] No Cookie present, aborting integration.
[ForumSessionProvider] No User detected, fall through to MediaWiki.
[ForumSessionProvider] Unable to provide session, database not loaded.
[session] Session "eit9eeb5k3o1bvt9i2mv1pmlfca3i8ps" requested without UserID cookie

Looks like a problem finding the cookie?  I've attempted to set the Legacy options, but that didn't improve anything.
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

Advertisement: