Files
computer-playbook/roles/web-app-xwiki/templates/xwiki.cfg.j2
Kevin Veen-Birkenbach f576b42579 XWiki: two-phase bootstrap + extension install before enabling auth; add XOR validation
- Add 02_validation.yml to prevent OIDC+LDAP enabled simultaneously
- Introduce _flush_config.yml with switches (OIDC/LDAP/superadmin)
- Bootstrap with native+superadmin → create admin → install extensions (superadmin) → enable final auth
- Refactor REST vars (XWIKI_REST_BASE, XWIKI_REST_XWIKI, XWIKI_REST_EXTENSION_INSTALL)
- Update templates to use switch vars; gate OIDC block in properties
- Idempotent REST readiness waits

Conversation: https://chatgpt.com/share/68c40c1e-2b3c-800f-b59f-8d37baa9ebb2
2025-09-12 14:04:02 +02:00

24 lines
1.2 KiB
Django/Jinja

# ---- Authentication selection
{% if xwiki_oidc_enabled_switch | bool %}
xwiki.authentication.authclass=org.xwiki.contrib.oidc.auth.OIDCAuthServiceImpl
{% elif xwiki_ldap_enabled_switch | bool %}
xwiki.authentication.authclass=org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl
xwiki.authentication.ldap=1
xwiki.authentication.ldap.trylocal={{ (XWIKI_LDAP_TRYLOCAL | bool) | ternary(1, 0) }}
xwiki.authentication.ldap.group_mapping=XWiki.XWikiAdminGroup={{ XWIKI_LDAP_ADMIN_GROUP_DN }}
xwiki.authentication.ldap.mode_group_sync=always
xwiki.authentication.ldap.server={{ XWIKI_LDAP_SERVER }}
xwiki.authentication.ldap.port={{ XWIKI_LDAP_PORT }}
xwiki.authentication.ldap.base_DN={{ XWIKI_LDAP_BASE_DN }}
xwiki.authentication.ldap.bind_DN={{ XWIKI_LDAP_BIND_DN }}
xwiki.authentication.ldap.bind_pass={{ XWIKI_LDAP_BIND_PASS }}
xwiki.authentication.ldap.fields_mapping={{ XWIKI_LDAP_FIELDS_MAPPING }}
xwiki.authentication.ldap.update_user=1
{% else %}
xwiki.authentication.authclass=com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl
{% endif %}
{% if xwiki_superadmin_enabled_switch | bool %}
# ---- Superadmin must live in xwiki.cfg (not in xwiki.properties)
xwiki.superadminpassword={{ XWIKI_SUPERADMIN_PASSWORD }}
{% endif %}