Keycloak – Create Admin User in a Realm

  1. Create regular user in a realm:
    1. Open admin console and select realm of your choice (realm selection box on top left side).
    2. Go to users (sidebar) -> add user (button on the right side)
    3. Fill in required fields and press save button.
    4. Open Credentials tab and set password.
    5. Open Role Mapping tab:
      1. Select realm-management under Client Roles.
      2. Select all available roles and press Add selected. (realm-admin is enough, other roles are inherited. Effective Roles will show the role mapping for the client)
  2. Go to http://keycloak/auth/admin/REALM_NAME/console (replace REALM_NAME with realm name in which you created the user) and login.
  3. You should see admin UI only for this realm.

You can also automate user creation via Admin REST API: https://www.keycloak.org/docs-api/21.0.0/rest-api/index.html

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)