دليل:$wgAuthManagerAutoConfig
Appearance
التصديق: $wgAuthManagerAutoConfig | |
---|---|
يسجل مزودي التصديق كي يستخدموها مع AuthManager |
|
أضيف في الإصدار: | 1.27.0 (Gerrit change 195297; git #d245bd25) |
حذف من الإصدار: | لا يزال مستخدم |
القيم المسموح بها: | طالع ما يلي |
القيمة الافتراضية: | طالع ما يلي |
إعدادات أخرى: أبجدية | حسب الدالة |
يجب على الامتدادات أن تسجل تنفيذات AuthenticationProvider
الخاصة بها مستخدمة هذا الإعداد حتى يتمكن AuthManager من التقاطها.
القيم المسموح بها
تجزيء يحتوي على ثلاثة مفاتيح، كل مفتاح هو قائمة بمواصفات ObjectFactory :
[
'preauth' => [ /* قائمة مقدمو التحقق المسبق */ ],
'primaryauth' => [ /* قائمة مقدمو التحقق الأولي */ ],
'secondaryauth' => [ /* قائمة مقدمو التحقق الثانوي */ ],
]
خلاف متغيرات ObjectFactory المعتادة، يجري التعرف على متغير sort
خاص؛ هو الذي سيحدد الترتيب الفعلي للمزودين (القيمة الافتراضية هي 0؛ القيمة الأصغر أولا؛ الترتيب مستقر).
المعتاد هو استخدام اسم فئة المزود في صفة مفتاح السلسلة (تيسيرًا على إداري الموقع الذي يرغب في تغييره؛ يتجاهل AuthManager مفاتيح السلاسل).
مثال
$wgAuthManagerAutoConfig['preauth'] = [
'MyPreAuthenticationProvider' => [
'class' => 'MyPreAuthenticationProvider',
'args' => [ 'arg1', 'arg2' ],
],
];
أو، لو كان الامتداد يستخدم تسجيل الامتداد (نوصي به):
{
//...
"AuthManagerAutoConfig": {
"preauth": {
"MyPreAuthenticationProvider": {
"class": "MyPreAuthenticationProvider",
"args": [ "arg1", "arg2" ]
}
}
},
//...
}
سوف ينشئ هذا عنصر مزود قبل التصديق مستخدمًا new MyPreAuthenticationProvider( 'arg1', 'arg2' )
، ويسجله في صفة واحد من مزودي التصديق.
قيمة افتراضية
إصدار ميدياويكي: | ≥ 1.43 |
$wgAuthManagerAutoConfig = [
'preauth' => [
ThrottlePreAuthenticationProvider::class => [
'class' => ThrottlePreAuthenticationProvider::class,
'sort' => 0,
],
],
'primaryauth' => [
// يجب أن يأتي TemporaryPasswordPrimaryAuthenticationProvider قبل أية PrimaryAuthenticationProvider تستند إلى PasswordAuthenticationRequest (أو على الأقل أي منها قد ترد FAIL بدلًا من ABSTAIN في حال كتابة كلمة مرور خطأ)، أو إعادة تعيين كلمة المرور لن تعمل مرة أخرى.
// لا تحذف هذا (أو تغير المفتاح) أو الضبط الآلي لمقدمي الخدمات المشابهين الآخرين في الامتدادات التي ربما سوف تدرج نفسها آليًا في المكان الخطأ.
TemporaryPasswordPrimaryAuthenticationProvider::class => [
'class' => TemporaryPasswordPrimaryAuthenticationProvider::class,
'services' => [
'DBLoadBalancerFactory',
],
'args' => [ [
// الرجوع إلى LocalPasswordPrimaryAuthenticationProvider
'authoritative' => false,
] ],
'sort' => 0,
],
LocalPasswordPrimaryAuthenticationProvider::class => [
'class' => LocalPasswordPrimaryAuthenticationProvider::class,
'services' => [
'DBLoadBalancerFactory',
],
'args' => [ [
// الأخير يجب أن يكون جازمًا، وإلا سوف يرى المستخدم رسالة خطأ ليست بالمساعدة (نصها مثل «معلومات التصديق المقدم غير مدعومة» بدلًا من «كلمة المرور الخطأ») لو فشلت هي الأخرى.
'authoritative' => true,
] ],
'sort' => 100,
],
],
'secondaryauth' => [
CheckBlocksSecondaryAuthenticationProvider::class => [
'class' => CheckBlocksSecondaryAuthenticationProvider::class,
'sort' => 0,
],
ResetPasswordSecondaryAuthenticationProvider::class => [
'class' => ResetPasswordSecondaryAuthenticationProvider::class,
'sort' => 100,
],
// الوصل الشبكي أثناء تسجيل الدخول أمر تجريبي، نشطه على مسؤوليتك الخاصة - T134952
// ConfirmLinkSecondaryAuthenticationProvider::class => [
// 'class' => ConfirmLinkSecondaryAuthenticationProvider::class,
// 'sort' => 100,
// ],
EmailNotificationSecondaryAuthenticationProvider::class => [
'class' => EmailNotificationSecondaryAuthenticationProvider::class,
'services' => [
'DBLoadBalancerFactory',
],
'sort' => 200,
],
],
];
إصدارات ميدياويكي: | 1.41 – 1.42 |
$wgAuthManagerAutoConfig = [
'preauth' => [
\MediaWiki\Auth\ThrottlePreAuthenticationProvider::class => [
'class' => \MediaWiki\Auth\ThrottlePreAuthenticationProvider::class,
'sort' => 0,
],
],
'primaryauth' => [
// TemporaryPasswordPrimaryAuthenticationProvider should come before any other PasswordAuthenticationRequest-based PrimaryAuthenticationProvider (or at least any that might return FAIL rather than ABSTAIN for a wrong password), or password reset won't work right.
// Do not remove this (or change the key) or auto-configuration of other such providers in extensions will probably auto-insert themselves in the wrong place.
\MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::class => [
'class' => \MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::class,
'services' => [
'DBLoadBalancerFactory',
],
'args' => [ [
// Fall through to LocalPasswordPrimaryAuthenticationProvider
'authoritative' => false,
] ],
'sort' => 0,
],
\MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider::class => [
'class' => \MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider::class,
'services' => [
'DBLoadBalancerFactory',
],
'args' => [ [
// Last one should be authoritative, or else the user will get a less-than-helpful error message (something like "supplied authentication info not supported" rather than "wrong password") if it too fails.
'authoritative' => true,
] ],
'sort' => 100,
],
],
'secondaryauth' => [
\MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider::class => [
'class' => \MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider::class,
'sort' => 0,
],
\MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider::class => [
'class' => \MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider::class,
'sort' => 100,
],
// Linking during login is experimental, enable at your own risk - T134952
// \MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class => [
// 'class' => \MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class,
// 'sort' => 100,
// ],
\MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::class => [
'class' => \MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::class,
'services' => [
'DBLoadBalancerFactory',
],
'sort' => 200,
],
],
];
إصدارات ميدياويكي: | 1.39 – 1.40 |
$wgAuthManagerAutoConfig = [
'preauth' => [
\MediaWiki\Auth\ThrottlePreAuthenticationProvider::class => [
'class' => \MediaWiki\Auth\ThrottlePreAuthenticationProvider::class,
'sort' => 0,
],
],
'primaryauth' => [
// TemporaryPasswordPrimaryAuthenticationProvider should come before
// any other PasswordAuthenticationRequest-based
// PrimaryAuthenticationProvider (or at least any that might return
// FAIL rather than ABSTAIN for a wrong password), or password reset
// won't work right. Do not remove this (or change the key) or
// auto-configuration of other such providers in extensions will
// probably auto-insert themselves in the wrong place.
\MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::class => [
'class' => \MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::class,
'services' => [
'DBLoadBalancer',
],
'args' => [ [
// Fall through to LocalPasswordPrimaryAuthenticationProvider
'authoritative' => false,
] ],
'sort' => 0,
],
\MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider::class => [
'class' => \MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider::class,
'services' => [
'DBLoadBalancer',
],
'args' => [ [
// Last one should be authoritative, or else the user will get
// a less-than-helpful error message (something like "supplied
// authentication info not supported" rather than "wrong
// password") if it too fails.
'authoritative' => true,
] ],
'sort' => 100,
],
],
'secondaryauth' => [
\MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider::class => [
'class' => \MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider::class,
'sort' => 0,
],
\MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider::class => [
'class' => \MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider::class,
'sort' => 100,
],
// Linking during login is experimental, enable at your own risk - T134952
// \MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class => [
// 'class' => \MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class,
// 'sort' => 100,
// ],
\MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::class => [
'class' => \MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::class,
'services' => [
'DBLoadBalancer',
],
'sort' => 200,
],
],
];
إصدارات ميدياويكي: | 1.37 – 1.38 |
$wgAuthManagerAutoConfig = [
'preauth' => [
MediaWiki\Auth\ThrottlePreAuthenticationProvider::class => [
'class' => MediaWiki\Auth\ThrottlePreAuthenticationProvider::class,
'sort' => 0,
],
],
'primaryauth' => [
// TemporaryPasswordPrimaryAuthenticationProvider should come before
// any other PasswordAuthenticationRequest-based
// PrimaryAuthenticationProvider (or at least any that might return
// FAIL rather than ABSTAIN for a wrong password), or password reset
// won't work right. Do not remove this (or change the key) or
// auto-configuration of other such providers in extensions will
// probably auto-insert themselves in the wrong place.
MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::class,
'services' => [
'DBLoadBalancer',
],
'args' => [ [
// Fall through to LocalPasswordPrimaryAuthenticationProvider
'authoritative' => false,
] ],
'sort' => 0,
],
MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider::class,
'services' => [
'DBLoadBalancer',
],
'args' => [ [
// Last one should be authoritative, or else the user will get
// a less-than-helpful error message (something like "supplied
// authentication info not supported" rather than "wrong
// password") if it too fails.
'authoritative' => true,
] ],
'sort' => 100,
],
],
'secondaryauth' => [
MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider::class,
'sort' => 0,
],
MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider::class,
'sort' => 100,
],
// Linking during login is experimental, enable at your own risk - T134952
// MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class => [
// 'class' => MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class,
// 'sort' => 100,
// ],
MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::class,
'services' => [
'DBLoadBalancer',
],
'sort' => 200,
],
],
];
إصدارات ميدياويكي: | 1.33 – 1.36 |
$wgAuthManagerAutoConfig = [
'preauth' => [
MediaWiki\Auth\ThrottlePreAuthenticationProvider::class => [
'class' => MediaWiki\Auth\ThrottlePreAuthenticationProvider::class,
'sort' => 0,
],
],
'primaryauth' => [
MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::class,
'args' => [ [
'authoritative' => false,
] ],
'sort' => 0,
],
MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider::class,
'args' => [ [
'authoritative' => true,
] ],
'sort' => 100,
],
],
'secondaryauth' => [
MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider::class,
'sort' => 0,
],
MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider::class,
'sort' => 100,
],
MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::class,
'sort' => 200,
],
],
];
إصدارات ميدياويكي: | 1.27 – 1.32 |
$wgAuthManagerAutoConfig = [
'preauth' => [
MediaWiki\Auth\LegacyHookPreAuthenticationProvider::class => [
'class' => MediaWiki\Auth\LegacyHookPreAuthenticationProvider::class,
'sort' => 0,
],
MediaWiki\Auth\ThrottlePreAuthenticationProvider::class => [
'class' => MediaWiki\Auth\ThrottlePreAuthenticationProvider::class,
'sort' => 0,
],
],
'primaryauth' => [
MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::class,
'args' => [ [
'authoritative' => false,
] ],
'sort' => 0,
],
MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider::class,
'args' => [ [
'authoritative' => true,
] ],
'sort' => 100,
],
],
'secondaryauth' => [
MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider::class,
'sort' => 0,
],
MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider::class,
'sort' => 100,
],
MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::class => [
'class' => MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::class,
'sort' => 200,
],
],
];