Set required user action to default Keycloak user

Hi!
Is there a way to set required user actions on the default created user at deploy time? I would like to enforce the user to have a two factor authentication mechanism.

Thank you!

In the Admin UI, go to AuthenticationRequired Actions and check Default Action checkbox for the actions you want to default for a new user. The one you’re describing is Configure OTP.

Thank you for your response! My issue is that I want to do this steps programmatically for the default existing admin user. e.g. 1. install/deploy Keycloak
2. try to login for the first time to the admin console using the admin user
3. OTP configuration mechanism should be displayed

You can load a realm configuration on startup Importing and Exporting Realms - Keycloak