mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-17 15:56:04 +02:00
oidc.php: autologin/localLogin templated via vars; optionally disable wgPasswordAttemptThrottle when 'web-svc-logout' present vars: set defaults (AUTOLOGIN=true, LOCALLOGIN=false); use path_join/url_join for clean paths/URLs Context: https://chatgpt.com/share/68caaf41-d098-800f-beb0-a473ff08c9c5
34 lines
1.1 KiB
Django/Jinja
34 lines
1.1 KiB
Django/Jinja
<?php
|
||
// ### OIDC (PluggableAuth) – BEGIN (managed by Ansible)
|
||
|
||
{% if MEDIAWIKI_OIDC_ENABLED | bool %}
|
||
|
||
{% if 'web-svc-logout' in CURRENT_PLAY_APPLICATIONS %}
|
||
# The cookie deletion of the logout app leads to a login bug if this isn't set
|
||
$wgPasswordAttemptThrottle = [];
|
||
{% endif %}
|
||
|
||
wfLoadExtension( 'PluggableAuth' );
|
||
wfLoadExtension( 'OpenIDConnect' );
|
||
|
||
$wgPluggableAuth_EnableAutoLogin = {{ MEDIAWIKI_OIDC_AUTOLOGIN | bool | ternary('true','false') }};
|
||
$wgPluggableAuth_EnableLocalLogin = {{ MEDIAWIKI_OIDC_LOCALLOGIN | bool | ternary('true','false') }};
|
||
$wgPluggableAuth_ButtonLabel = '{{ MEDIAWIKI_OIDC_BUTTON_TEXT }}';
|
||
|
||
$wgPluggableAuth_Config = [
|
||
[
|
||
'plugin' => 'OpenIDConnect',
|
||
'data' => [
|
||
'providerURL' => '{{ MEDIAWIKI_OIDC_ISSUER }}',
|
||
'clientID' => '{{ MEDIAWIKI_OIDC_CLIENT_ID }}',
|
||
'clientsecret' => '{{ MEDIAWIKI_OIDC_CLIENT_SECRET }}',
|
||
'scope' => [ 'openid', 'profile', 'email' ],
|
||
],
|
||
],
|
||
];
|
||
|
||
$wgOpenIDConnect_UseEmailNameAsUserName = true;
|
||
$wgOpenIDConnect_MigrateUsers = true;
|
||
// ### OIDC (PluggableAuth) – END
|
||
|
||
{% endif %} |