Manual:$wgPasswordConfig

From MediaWiki.org
Jump to: navigation, search

Other languages:
English • ‎español • ‎日本語 • ‎polski
Access: $wgPasswordConfig
Configuration for built-in password types.
Introduced in version: 1.24.0
Removed in version: still in use
Allowed values: array
Default value: see below
Other settings: Alphabetical | By function

Details[edit]

Configuration for built-in password types. Maps the password type to an array of options. The 'class' option is the Password class to use. All other options are class-dependent.

Default[edit]

$wgPasswordConfig = array(
   'A' => array(
       'class' => 'MWOldPassword',
   ),
   'B' => array(
       'class' => 'MWSaltedPassword',
   ),
   'pbkdf2-legacyA' => array(
       'class' => 'LayeredParameterizedPassword',
       'types' => array(
           'A',
           'pbkdf2',
       ),
   ),
   'pbkdf2-legacyB' => array(
       'class' => 'LayeredParameterizedPassword',
       'types' => array(
           'B',
           'pbkdf2',
       ),
   ),
   'bcrypt' => array(
       'class' => 'BcryptPassword',
       'cost' => 9,
   ),
   'pbkdf2' => array(
       'class' => 'Pbkdf2Password',
       'algo' => 'sha512',
       'cost' => '30000',
       'length' => '64',
   ),
);


Example[edit]

The following example shows on how user-defined password encryptions can be added to the LocalSettings.phpManual:LocalSettings.php file:

$wgPasswordConfig['bcrypt-peppered'] = array(
    'class' => 'EncryptedPassword',
    'underlying' => 'bcrypt',
    'secrets' => array(),
    'cipher' => MCRYPT_RIJNDAEL_256,
    'mode' => MCRYPT_MODE_CBC,
    'cost' => 5,
);

See also[edit]