Hi!
As so many I am also trying to fix some sort of single sign-on for several services. My situation: I get an encrypted username and password from another website, decrypt it and than want to authenticate and/or create the user exactly as is done through the regular login form (behind which in my case an Ldap plugin is doing its magic). I was hoping you guys could put me on the right track. I tried many things much like the following (which obviously runs into many errors).
<?php require_once('includes/SpecialUserlogin.php'); require_once('includes/AuthPlugin.php'); require_once('includes/WebRequest.php'); define('MEDIAWIKI', true); require_once('LocalSettings.php'); $wgRequest = new FauxRequest( array ( 'wpName' => 'username', // dynamically filled 'wpPassword' => 'password', // dynamically filled 'wpDomain' => 'MYDOMAIN', 'wpRemember' => '1', 'wpLoginattempt' => 'Log in', 'returnto' => 'Main_Page', // dynamically filled )); $form = new LoginForm( $wgRequest ); $form->execute(); ?>
Do I need to create another object (AuthPlugin?) or use the $wgAuth somehow? A little push in the right direction would be greatly appreciated. Using the mediawiki Api (ApiLogin.php) I can authenticate but I do not know how to use this further.
Sorry for my ignorance but I do not seem to be able to read the php of mediawiki well enough to provide the solution myself. Browsing the wiki's, googling and searching this mail list has so far not helped.
Kind regards,
Jac (Istanbul, Turkey)