Skip to content

Keycloak is storing error events even if storing events is disabled #21698

Closed

Description

@mhajas

Before reporting an issue

Area

storage

Describe the bug

It seems to be
Caused-by: #17644

This code:

if (sendImmediately) {
KeycloakModelUtils.runJobInTransaction(session.getKeycloakSessionFactory(), session.getContext(), session -> {
EventStoreProvider store = session.getProvider(EventStoreProvider.class);
List<EventListenerProvider> listeners = getEventListeners(session, realm);
sendNow(store, eventTypes, listeners);
});
} else {
sendNow(this.store, eventTypes, this.listeners);
}

Is not checking realm.isEventsEnabled() flag.

Version

22.0.0

Expected behavior

No events are stored when they are disabled

Actual behavior

Immediately sent events are stored all the time (all error events by default)

How to Reproduce?

  • Make sure the tested realm has disabled events
  • Try login with a wrong password
  • LOGIN_ERROR event is stored

Anything else?

No response

Activity

  1. ghost added
    area/storageStorage layer — JPA entities, database schemas, Liquibase migrations, caching
    on Jul 14, 2023
  2. added this to the 22.0.1 milestone on Jul 14, 2023
  3. self-assigned this
    on Jul 14, 2023
  4. added a commit that references this issue on Jul 14, 2023
    6a97520
  5. added a commit that references this issue on Jul 14, 2023
    07c2733
  6. added a commit that references this issue on Jul 17, 2023
    804e97e
  7. added a commit that references this issue on Jul 17, 2023
    6d28c31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/storageStorage layer — JPA entities, database schemas, Liquibase migrations, cachingkind/bugCategorizes a PR related to a bug

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions