Hi everyone,
we are currently running Keycloak 6.0.1 with some automated tests for our config. Our realm has a password minimum length set to 10. So one of our tests tries to create a user with the empty password “”.
With Keycloak 6.0.1 we are getting HTTP 407 Conflict and a suitable exception message. This is the expected behavior of the test.
After updating to Keycloak 8.0.1 the behavior changed and we were getting HTTP 500 and the response {"error":"unknown_error"}.
The logs show the attached stacktrace caused by a NullPointerException.
Creating a user with another invalid, but not empty password (e.g. “soShort”) shows the expected behavior.
I was able to recreate this by using a plain local Keycloak 8.0.1 with the password minimum length of the master realm set to 8 and the call:
curl --dump-header - -X POST \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json; charset=utf-8" \
-d '{"id" : "test", "email" : "
te...@gmail.com", "username": "test", "credentials": [{"temporary": false, "type": "password", "value":""}]}' \
(replace <TOKEN> with a valid admin-cli master realm token)
So my question is whether this this change was intended or whether this is a bug?
cheers,
Thomas :)