Extension:TwitterLogin

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
TwitterLogin

Release status: beta

Implementation User identity
Description Register and log in (authenticate) to a mediawiki using your twitter account
Author(s) David Raison and Dave Challis (Clausekwistalk)
Latest version 0.02 (2011-10-9)
MediaWiki 1.17.*
Database changes Yes
License CC BY-SA 3
Download
Example dev.hacker.lu wiki
Parameters

$wgConsumerKey, $wgConsumerSecret

Hooks used
BeforePageDisplay

LoadExtensionSchemaUpdates
UserLoadFromSession
UserLogoutComplete

Translate the TwitterLogin extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

This extension adds Twitter OAuth sign up capabilities to Mediawiki. The code is derived from Dave Challis' implementation done for Web8D 2010 and also uses the twitteroauth library by Abraham Williams.

You need to register an application with Twitter in order to be able to use this extension. See the Configuration section for more details on how to register a Twitter app.

Known issues[edit | edit source]

This extension does not work with MediaWiki 1.19 and higher when you require your users to confirm their email addresses ($wgEmailConfirmToEdit=true), since setting an email address now requires a password (which does not exist for users who authenticate through Twitter).

Setup[edit | edit source]

Dependencies[edit | edit source]

The twitteroauth library requires the php-curl module.

Installing[edit | edit source]

  • Download and extract the file(s) in a directory called TwitterLogin in your extensions/ folder. If you're a developer and this extension is in a Git repository, then instead you should clone the repository using:
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/TwitterLogin.git
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/TwitterLogin/TwitterLogin.php";

Configuration[edit | edit source]

In order to use this extension, you will need to register your MediaWiki installation as a Twitter app. You can do so here.
You will need to set a callback url in your app's settings. This will in most cases be https://wouwikidomain.tld/wiki/Special:TwitterLogin/callback.

When you have registered your application, you will get a consumer key and secret. Add these to your LocalSettings.php file, just below the line where you required the extension:

include_once("$IP/extensions/TwitterLogin/TwitterLogin.php");
$wgConsumerKey = '[yourkey]';
$wgConsumerSecret = '[yoursecret]';

Release Notes[edit | edit source]

  • 0.1 - Initial release.
  • 0.2 - Now uses MediaWiki's http class instead of curl directly.

Dev[edit | edit source]

Todo[edit | edit source]

  • Support tying Twitter screen-names to existing MediaWiki accounts.
  • Redirect first time users to their preferences screen to let them confirm their email address.
  • Add an option to be set in LocalSettings.php whether twitter users should be automatically emailconfirmed or not.
Language: English  • Deutsch