python-keycloak icon indicating copy to clipboard operation
python-keycloak copied to clipboard

Create admin user in new Realm programmatically

Open Macscroge opened this issue 4 years ago • 2 comments
trafficstars

    keycloak_admin.create_realm_role({'name': 'admin', 'clientRole': False, 'composite': True, 'description': 'admin user'})

I am trying to create an admin user for new Realms upon creation. I cannot set composite to True, after creation the value is always False no matter what value I set.

Macscroge avatar Sep 25 '21 16:09 Macscroge

You are creating a new role with that, not a new user (with admin rights). Use create_user() and assign_realm_roles().

double-a avatar Oct 10 '21 17:10 double-a

But a new realm does not have an admin user by default right? So a new admin role must be created first?

Macscroge avatar Nov 02 '21 12:11 Macscroge