Manual:Hooks/AuthPluginSetup

From MediaWiki.org
Jump to navigation Jump to search
AuthPluginSetup
Available from version 1.9.1
Update or replace authentication plugin object ($wgAuth). Gives a chance for an extension to set it programmatically to a variable class.
Define function:
public static function onAuthPluginSetup( $auth ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"AuthPluginSetup": "MyExtensionHooks::onAuthPluginSetup"
	}
}

For MediaWiki ≤1.25:

$wgHooks['AuthPluginSetup'][] = 'MyExtensionHooks::onAuthPluginSetup';
Called from:File(s): Setup.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:AuthPluginSetup extensions.

Details[edit]

$auth: the $wgAuth object, probably a stub

Deprecated[edit]

From MediaWiki 1.27 on, the hook is deprecated and superseded by AuthManager functionality. Instead of subclassing AuthPlugin, authentication extensions should implement a PrimaryAuthenticationProvider and use $wgAuthManagerAutoConfig to register it.