8000 Searching user by attributes force an exact request even if not asked · Issue #39915 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Searching user by attributes force an exact request even if not asked #39915
Closed
@gdelbos

Description

@gdelbos

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

admin/ui

Describe the bug

When search a user by a custom attribute, you can state if you want an exact search or not.
However, checking the exact search or not does not change anything : the search is done using the exact value.

Version

26.2.4

Regression

  • The issue is a regression

Expected behavior

The search should be using the exact value only when the checkbox is ticked.

Actual behavior

The search is using the exact value regardless of the checkbox.

How to Reproduce?

  • Define a new attribute for the user registration (my-attribute)
  • Create a user with the value my-value for this attribute
  • Search users by attribute with the following constraint
    • Attribute: my-attribute
    • Value: value
    • Exact: false(checkbox unchecked)
  • Validate and search.

Anything else?

There are at least two ways to correct this issue but I don't have the correct knowledge to chose which is the valid place.

The first possibility is by changing the way the request is managed by the ui API (class BruteForceUsersResource).

The second possibility is by changing the way the JPA request is build (class JpaUserProvider) where we can see some kind of inconsistency on how the attribute exact is managed:

  • for "known attributes": Boolean.parseBoolean(attributes.get(UserModel.EXACT))
  • for "unknown attributes: Boolean.parseBoolean(attributes.getOrDefault(UserModel.EXACT, Boolean.TRUE.toString()))

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0