Authentication Parameters

Last modified by Thomas Mortagne on 2026/10/14 10:44

Reference

Authentication is configured in the xwiki.cfg file. Apart from xwiki.authentication itself, every parameter below is prefixed with xwiki.authentication. — the second row of the first table is therefore written xwiki.authentication.always=1.

Login Flow

NameAllowed valuesDefaultDescription
xwiki.authenticationform, basicformHow the standard authenticator asks for credentials.
always0, 10Authenticate on every request instead of once per session.
authclassJava class namenoneThe authenticator to use, overriding the choice made in the wiki administration. The values are listed in Authentication Types.
createuseremptynoneCreate a wiki profile for the users an external system authenticated. Required by Container and Kerberos authentication.
realmnameStringXWikiRealm name sent with an HTTP Basic challenge.
defaultpageStringthe wiki home pagePage to redirect to after login when no xredirect parameter was given.
loginpageString/bin/login/XWiki/XWikiLoginPage to redirect to when the user is not logged in.
loginsubmitpageString/loginsubmit/XWiki/XWikiLoginURL the login form posts the credentials to.
logoutpageStringsee belowPage to redirect to after logging out.
errorpageString/bin/loginerror/XWiki/XWikiLoginPage to redirect to when the login failed.

The shipped xwiki.cfg already gives logoutpage a pattern that matches the logout action whatever the path in front of it, so that logging out keeps working with short URLs and with path-based subwikis. Replace it only when the wiki is served from a different URL layout.

Only realmname applies when xwiki.authentication is set to basic; the redirection parameters belong to the form flow.

Remember-Me Cookies

NameAllowed valuesDefaultDescription
cookieprefixStringemptyPrefix added to the names of the authentication cookies.
cookiepathString/Path the cookies are sent to. Set it to the context path of the wiki, /xwiki for instance, when something else runs on the same server.
cookiedomainsComma-separated listthe server host nameDomains the cookies are shared with, which is only needed to share a session between the wikis of a farm.
cookielifeNumber14Number of days before the cookies expire.
protectionall, validation, encryption, noneallProtection applied to the cookie values.
useiptrue, falsetrueBind the cookies to the IP address that obtained them, which forces a new login when it changes.
validationKeyStringgeneratedKey used to hash the cookie so that tampering is detected. XWiki 18.9.0+ Also used to derive the CSRF tokens.
encryptionKeyStringgeneratedKey used to encrypt the cookie values.
encryptionalgorithmStringthe cipher defaultAlgorithm used to encrypt and decrypt the cookies.
encryptionmodeStringthe cipher defaultCipher mode used to encrypt and decrypt the cookies.
encryptionpaddingStringthe cipher defaultPadding used to encrypt and decrypt the cookies.

When validationKey or encryptionKey is not set, XWiki generates a random value the first time it needs it and stores it in the configuration.properties file of the permanent directory. In a cluster, set the same random value on every node, otherwise users are logged out whenever the load balancer switches nodeXWiki 18.9.0+  and the CSRF tokens of one node are rejected by the others. Like any parameter of xwiki.cfg, they can also be set without editing the file, for example from a secret store, with the XCONF_xwikicfg_xwiki_authentication_validationKey and XCONF_xwikicfg_xwiki_authentication_encryptionKey environment variables.

FAQ

Do the encryption and validation keys have to be set?

No. When they are left empty XWiki generates them and stores them, so a fresh instance protects its cookies without any configuration.

Where are the failed-login strategies configured?

Not in xwiki.cfg: they belong to the wiki administration and to the Authentication API extension.

Related

Get Connected