Authentication Parameters

Last modified by Eleni Cojocariu-testing account on 2026/08/11 00:45

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.
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.

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