User Authenticated Event Backport

Last modified by Admin on 2026/08/15 00:14

cogAllow adding support for sending UserAuthenticatedEvent in extensions which support XWiki versions older than 13.3RC1
TypeJAR
CategoryOther
Developed by

Thomas Mortagne

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Compatibility

Support XWiki 8.4+, and not needed anymore in XWiki >= 16.10.19/17.10.12/18.4.4/18.7.0RC1.

Success

Installable with the Extension Manager

Description

Information

You need to add this as a dependency of your authenticator only if you plan to support XWiki < 16.10.19/17.10.12/18.4.4/18.7.0RC1, as after that org.xwiki.security.authentication.UserAuthenticatedEventNotifier in include in xwiki-platform-security-authentication-api.

Allow adding support for sending UserAuthenticatedEvent in extensions which support XWiki versions older than 13.3RC1.

In general the common process would be to add it as dependency to your authenticator project:

    <dependency>
      <groupId>org.xwiki.contrib</groupId>
      <artifactId>userauthenticatedevent-backport</artifactId>
      <version>1.0.0</version>
    </dependency>

And then use the org.xwiki.security.authentication.UserAuthenticatedEventNotifier component:

@Inject
private UserAuthenticatedEventNotifier notifier;

public checkAuth()
{
    // Authenticate and remember the user in the session
    principal = authenticate();
    if (principal == null) {
        // Notify about this new authentication
        getNotifier().notify(principal.getName());

        return new XWikiUser(principal.getName());
    }

    return null;
}

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.

Versions

Dependencies

Dependencies for this extension (org.xwiki.contrib:userauthenticatedevent-backport 1.0.0):

Get Connected