Extension:LinkedInAuth

Category:Extensions without a compatibility policyCategory:Apache licensed extensions
MediaWiki extensions manual
LinkedInAuth
Release status: stableCategory:Stable extensions
Implementation User access Category:User access extensions
Description Adds LinkedIn OAuth login to MediaWiki with Special pages and a <linAuth> tag.
Author(s) Michele Fella <michele.fella@gmail.com> (Michele.Fellatalk)
MediaWiki 1.43+Category:Extensions with manual MediaWiki version
Licence Apache License 2.0 or later
Download Category:Extensions in GitHub version control
Category:All extensionsCategory:Extensions not in ExtensionJson

LinkedInAuth provides a complete LinkedIn OAuth login flow inside MediaWiki. It includes:

  • A parser tag (<linAuth>) to render login buttons/links.
  • Special pages for login, callback, auto-login, status, users, and a welcome page.
  • Automatic MediaWiki user creation and group assignment.
  • LocalSettings-only configuration (no external secrets required).

Installation

  1. Download or clone from GitHub
  2. Copy or extract the extension into extensions/LinkedInAuth.
  3. Add to LocalSettings.php:
 
wfLoadExtension( 'LinkedInAuth' ); 
$wgGroupPermissions['sysop']['linauth'] = true; 

$wgLinkedInAuthClientId = '...'; 
$wgLinkedInAuthClientSecret = '...'; 
$wgLinkedInAuthHmacKey = '...'; 

# Recommended LinkedIn redirect URL (index.php form) 
$wgLinkedInAuthCallbackUrl = 'https://your-wiki.example/index.php?title=Special:LinkedInAuthCallback'; 

# Optional overrides 
$wgLinkedInAuthLoginUrl = ''; 
$wgLinkedInAuthAutoLoginUrl = ''; 
$wgLinkedInAuthDefaultReturnTo = 'Main_Page'; 
$wgLinkedInAuthLogPath = ''; // default: $IP/sso_login_debug.log 
$wgLinkedInAuthDebug = false;
  1. Run database updates:

php maintenance/run.php update

Configuration

$wgLinkedInAuthClientId
LinkedIn application Client ID.
$wgLinkedInAuthClientSecret
LinkedIn application Client Secret.
$wgLinkedInAuthHmacKey
Secret used to sign auto-login tokens.
$wgLinkedInAuthCallbackUrl
Callback URL (redirect URI) used by LinkedIn. If empty, defaults to Special:LinkedInAuthCallback.
$wgLinkedInAuthLoginUrl
Optional override for the login URL used by the <linAuth> tag.
$wgLinkedInAuthAutoLoginUrl
Optional override for the auto-login URL.
$wgLinkedInAuthDefaultReturnTo
Default landing page if returnTo is not provided.
$wgLinkedInAuthLogPath
Debug log file path. If empty, defaults to $IP/sso_login_debug.log.
$wgLinkedInAuthDebug
Enable debug logging (true/false).

Usage

Parser tag

 
<linAuth type="button">Login via LinkedIn</linAuth> 
<linAuth type="link">Login via LinkedIn</linAuth> 
<linAuth type="custom"> 
<a class="mw-ui-button" href="{{fullurl:Special:LinkedInAuthLogin}}">Login via LinkedIn</a> 
</linAuth>
  • type="button" (default) renders a MediaWiki button.
  • type="link" renders a standard link.
  • type="custom" renders the content as-is (wikitext expanded).

Special pages

  • Special:LinkedInAuthLogin — starts the OAuth flow.
  • Special:LinkedInAuthCallback — OAuth callback handler.
  • Special:LinkedInAuthAutoLogin — MediaWiki session login.
  • Special:LinkedInAuthStatus — configuration status (admin only).
  • Special:LinkedInAuthUsers — list LinkedIn-created users with safe delete (admin only).
  • Special:LinkedInAuthWelcome — optional post-login landing page (admin only).

LinkedIn App Setup

Configure these redirect URIs in your LinkedIn Developer app:

Category:All extensions Category:Apache licensed extensions Category:Extensions in GitHub version control Category:Extensions not in ExtensionJson Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:LoadExtensionSchemaUpdates extensions Category:ParserFirstCallInit extensions Category:Stable extensions Category:User access extensions