Opauth integration module for Mediawiki engine. This extension integrates Opauth with 4 predefined strategies ( Facebook, Google, LinkedIn and Twitter ). It provides Special Page entrypoint & endpoint for authentication handling via Opaith library and provides hook for external handling.
- Put Opauth folder into extensions folder
- Add these lines into LocalSettings.php:
require_once "$IP/extensions/Opauth/Opauth.php";
$wgOpauthConfig['security_salt'] = 'YOUR_RANDOM_SALT_STRING';
$wgOpauthConfig['Strategy'] = array(
'Facebook' => array(
'app_id' => 'YOUR_APP_ID',
'app_secret' => 'YOUR_APP_SECRET',
'scope' => 'public_profile,email'
),
'Google' => array(
'client_id' => 'YOUR_APP_ID',
'client_secret' => 'YOUR_APP_SECRET'
),
'Twitter' => array(
'key' => 'YOUR_APP_ID',
'secret' => 'YOUR_APP_SECRET'
),
'LinkedIn' => array(
'api_key' => 'YOUR_APP_ID',
'secret_key' => 'YOUR_APP_SECRET'
)
);
- For more configuration information please see https://github.com/opauth/opauth
- Use code below to fetch social-auth url:
OpauthHelper::getLoginLink('facebook'); // where 'facebook' is provider name
- Create your own extension which listen OpauthUserAuthorized hook. This hook will be called with parameters listed below in sample callback function:
public static function onOpauthUserAuthorized( $provider, $uid, $info, $raw ) { ... }