keycloak-ui
keycloak-ui copied to clipboard
Empty user attributes break UI
Describe the bug
Adding an empty user attribute breaks UI
Version
19.0.2 Quarkus
Expected behavior
- Open user's page
- Select attributes
- Empty attribute (key only) is displayed
Actual behavior
- Open user's page
- Select attributes
- Page crashes with "Cannot read properties of null (reading 'trim')"
How to Reproduce?
- Add empty attribute to user (key only)
- Save
- Change page
- Enter user's page again
- Select attributes
Anything else?
No response
I couldn't reproduce the issue. What do you exactly mean by 'change page'?
Ok, this also works:
- Create new User
- Open attributes tab
- add an empty attribute (key only!)
- Press save
- Reload page => Crash
EDIT: DB is Oracle 19
@jruhe-adesso I was also unable to recreate your issue. I tried both sets of instructions.
Can you try the latest nightly build and let us know if it works? https://github.com/keycloak/keycloak/releases/tag/nightly
@ssilvert we are going to perform some experiments. Let you know about results. This is a critical production issue for us.
We use the version 19.0.2. The problem occurs, if you use oracle as a DB-Vendor. We tried it with the nightly docker image and had the same problem.
We assume, that the problem is caused by Oracle's interpretation, that empty strings are null.
As an addition to Aaron's comment (a colleague of mine), we recently switched from 18.0.2-legacy to 19.0.2 Quarkus and that was the point, where the issue appeared. Might be an UI-Problem only, but as we create and read users programatically by using the keycloak client as well, there might be other side effects caused by this issues. We are further investigating this.
EDIT
I just found a running 18.0.2-legacy in our infrastructure. Payload of a user with empty attribute is this:
19.0.2 Quarkus
So, payload is identical, which strongly indicates, that the new React UI cannot handle arrays with a single "null" entry (instead of "").
@jruhe-adesso could you file that as a separate issue? I'd like to avoid cluttering the discussion.
The old admin console does not allow you to submit empty attributes at all.
While the REST API should be the foremost enforcer of these rules, we should fix this in the new UI and then transfer this issue over to the server team for final resolution.
The old admin console does not allow you to submit empty attributes at all.
Adding a non whitespace character and then deleting it enables the save button.