@Unauthenticated
    @Timed
    @Override
    public Boolean resetEmail(final String emailAddress) throws NoSuchUserException {
        final AuthenticateEventAction.Builder<Void> eventBuilder = event.logging.AuthenticateEventAction.builder()
                .withAuthenticationEntity(event.logging.User.builder()
                        .withEmailAddress(emailAddress)
                        .build())
                .withAction(AuthenticateAction.RESET_PASSWORD);

        try {
            final boolean resetEmailSent = serviceProvider.get().resetEmail(emailAddress);
            if (resetEmailSent) {
                return true;
            }
            throw new NotFoundException("User does not exist");
        } catch (Throwable e) {
            eventBuilder.withOutcome(AuthenticateOutcome.builder()
                    .withSuccess(false)
                    .withPermitted(false)
                    .withReason(AuthenticateOutcomeReason.OTHER)
                    .withData(Data.builder()
                            .withName("Error")
                            .withValue(e.getMessage())
                            .build())
                    .withDescription(e.getMessage())
                    .build());
            throw e;
        } finally {
            stroomEventLoggingServiceProvider.get().log(
                    "AuthenticationResourceImpl.resetEmail",
                    "User requested a password email to be sent.",
                    eventBuilder.build());
        }
    }
Called as part of logout flow when using internal identity provider.
stroom-security/stroom-security-identity/src/main/java/stroom/security/identity/authenticate/AuthenticationResourceImpl.java