Set Up a Groovy Authenticator in a Wiki Page
Last modified by Eleni Cojocariu-testing account on 2026/08/11 00:45
Steps
To authenticate through a script kept in a wiki page:
- Create a wiki page whose content is Groovy code returning an XWikiAuthService object.
- Save that page as a user who has programming rights, since the code only runs while the page has them.
- Set the Groovy authenticator in the xwiki.cfg file:
xwiki.authentication.authclass=com.xpn.xwiki.user.impl.xwiki.GroovyAuthServiceImpl - Point the authenticator at the page holding the code:
xwiki.authentication.groovy.pagename=MySpace.MyPage - Restart the wiki.
- Log in and check that your script decided the outcome; when it could not be used, the wiki logs "No page specified for auth service implementation" or a missing programming rights error instead.
FAQ
Where else can the page name be set?
The authenticator first looks for a groovy_pagename preference in the wiki preferences, and only then falls back to xwiki.authentication.groovy.pagename in xwiki.cfg.
Why is the script ignored?
Either no page is configured, or that page does not have programming rights; both cases are logged as an error and leave the wiki with no working authenticator.