Jump to content

Extension:CentralAuth/Hooks/CentralAuthLoginRedirectData

From mediawiki.org
CentralAuthLoginRedirectData
Available from version ???
This hook is called after a user has logged in to a single wiki during the login process, when saving any required data to the token store before redirecting to the login wiki.
Define function:
public static function onCentralAuthLoginRedirectData( CentralAuthUser $centralUser, array &$data ) { ... }
Attach hook:
$wgHooks['CentralAuthLoginRedirectData'][] = 'MyExtensionHooks::onCentralAuthLoginRedirectData';
Called from:File(s): CentralAuth / includes/CentralAuthHooks.php
Function(s): doCentralLoginRedirect

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

Parameters

[edit]
  • $centralUser: An instance of CentralAuthUser
  • $data: An associative array of data, containing the following keys:
    • 'secret': A string of random data generated by MWCryptRand::generateHex()
    • 'name': A string representing the name of the central user (filled in by CentralAuthUser::getName())
    • 'guid': A int representing the global user ID of the central user (filled in by CentralAuthUser::getId())
    • 'wikiId': A string representing an ASCII string identifier of the wiki (filled in by wfWikiID())
    • 'secureCookies': A bool representing whether cookies are secure or not
    • 'finalProto': A string representing the final protocol of the page, either 'http' or 'https'
    • 'currentProto': A string representing the current protocol of the page, either 'http' or 'https'