Search code examples
keycloak

Keycloak 23: can't change password in non-master realm?


I have two realms (master and realm2), and each has one user, named admin. With kcadm.sh, I can authenticate and change the password of the first user:

$ kcadm.sh config credentials --server http://localhost:8095 --realm master --user admin --password my-passwd
$ kcadm.sh set-password --username admin --new-password my-new-passwd

...but I can't find a way to change the password for the realm2 admin user. I've tried:

$ kcadm.sh config credentials --server http://localhost:8095 --realm master --user admin --password my-master-passwd
Logging into http://localhost:8095 as user admin of realm master
$ kcadm.sh set-password --realm realm2 --username admin --new-password new-realm2-passwd
null [unknown_error]

And:

$ kcadm.sh config credentials --server http://localhost:8095 --realm realm2 --user admin --password my-realm2-passwd
Logging into http://localhost:8095 as user admin of realm realm2
$ kcadm.sh set-password --username admin --new-password new-realm2-passwd
null [unknown_error]

Adding --realm realm2 to the last command doesn't help, and forcibly terminating realm2 sessions doesn't help.

Any ideas? I've tried enabling logging, but level DEBUG produces thousands of lines of output, and INFO produces none.


Solution

  • --realm isn't a valid option for set-password. Try -r, or --target-realm. Run kcadm.sh help set-password for details.