WARNING: This post is very technical and therefore only for those who care about such stuff.
Today I tackled an interesting problem - that being the integration of user accounts/login between PwlMMO and MediaWiki. This will allow users of any Pwl MMO to have linked pages & edits in an associated Wiki. The following post discusses the method used for this integration…
There are two primary ways of approaching this problem:
- Use the MediaWiki AuthPlugin method which redirects all Wiki account/login messages to the associated system (in this case the Pwl AMS (Account Management System).
- Account replication. Create a MediaWiki account to match each PwlMMO account.
For this case, I chose #2. The first is more elegant to be sure but more time consuming to code. #2 was created in maybe a little over a dozen lines of PHP code. I simply made one routine which is called to create a Wiki account that can be called when PwlAMS creates a new account, and another that does the same for logins.
The only problem I had in creating these routines was with Login. I started out using cURL for PHP but had too many problems with updating the HTTP headers (specifically Cookies) so the user’s web browser would retain the login info from one environment (AMS) to another (MediaWiki). I figured that there had to be some PHP-based Wiki-Bot code out on the net (like the nice dotNetWikiBot code I’m using for C# code) that had solved this. I did find some examples that used a PHP library called ‘Snoopy’. I implemented this and it still didn’t work! A little more searching revealed an example that explicitly did a setcookie and increased the validity time of the cookie. That did it. w00t!
The only problem remaining is if a user goes to the Wiki’s Login page right now, they won’t be logged in to the AMS. I will likely redirect login to the AMS login for consistency but for now we have a go for Wiki/Virtual World integration without multiple painful accounts.
I may eventually take some more time and support OpenID in PwlMMO as many other systems (like MediaWiki) either directly or through well developed plugins support this unified external account technology/system.
0 comments ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment