I am using a client to create a new keycloak user. Something like this:
keycloak.realm(realm)
.users()
.create(user);
The user variable is a UserRepresentation
object, and I'm trying to add an Update Password
required action:
user.setRequiredActions(singletonList("Update Password"))
User gets created ok, the problem is that I don't have the required action set
Not sure what I'm doing wrong, should I specify a different value in the required actions list?
Thanks
Required Actions are tasks that a user must finish before they are allowed to log in. A user must provide their credentials before required actions are executed. Once a required action is completed, the user will not have to perform the action again.
You can only create an initial admin user on the Welcome Page if you connect using localhost . This is a security precaution. You can also create the initial admin user at the command line with the add-user-keycloak.sh script. For more details see Server Installation and Configuration and Server Administration.
To access the admin console, open http://localhost:8080/auth/admin/ in a browser. You will be redirected to the Keycloak login pages, where you can log in with the admin username and password you created in the previous section while installing Keycloak.
Figured out what was up.
Keycloak has an enum to represent various user actions:
public static enum RequiredAction {
VERIFY_EMAIL, UPDATE_PROFILE, CONFIGURE_TOTP, UPDATE_PASSWORD, TERMS_AND_CONDITIONS
}
So the value should be "UPDATE_PASSWORD"
not "Update password"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With