|
@ -43,6 +43,7 @@ python-keycloak depends on: |
|
|
* Python 3 |
|
|
* Python 3 |
|
|
* `requests <http://docs.python-requests.org/en/master/>`_ |
|
|
* `requests <http://docs.python-requests.org/en/master/>`_ |
|
|
* `python-jose <http://python-jose.readthedocs.io/en/latest/>`_ |
|
|
* `python-jose <http://python-jose.readthedocs.io/en/latest/>`_ |
|
|
|
|
|
* `simplejson <https://simplejson.readthedocs.io/en/latest/>`_ |
|
|
|
|
|
|
|
|
Tests Dependencies |
|
|
Tests Dependencies |
|
|
------------------ |
|
|
------------------ |
|
@ -169,14 +170,23 @@ Main methods:: |
|
|
# Get clients belonging to the realm Returns a list of clients belonging to the realm |
|
|
# Get clients belonging to the realm Returns a list of clients belonging to the realm |
|
|
clients = keycloak_admin.get_clients() |
|
|
clients = keycloak_admin.get_clients() |
|
|
|
|
|
|
|
|
|
|
|
# Get client - id (not client-id) from client by name |
|
|
|
|
|
client_id=keycloak_admin.get_client_id("my-client") |
|
|
|
|
|
|
|
|
# Get representation of the client - id of client (not client-id) |
|
|
# Get representation of the client - id of client (not client-id) |
|
|
client = keycloak_admin.get_client(client_id='id-client') |
|
|
|
|
|
|
|
|
client_roles = keycloak_admin.get_client_role(client_id=client_id) |
|
|
|
|
|
|
|
|
# Get all roles for the client |
|
|
# Get all roles for the client |
|
|
client_roles = keycloak_admin.get_client_role(client_id='id-client') |
|
|
|
|
|
|
|
|
client_roles = keycloak_admin.get_client_role(client_id=client_id) |
|
|
|
|
|
|
|
|
|
|
|
# Create client role |
|
|
|
|
|
keycloak_admin.create_client_role(client_id, "test") |
|
|
|
|
|
|
|
|
|
|
|
# Get client role id from name |
|
|
|
|
|
role_id = keycloak_admin.get_client_role_id(client_id=client_id, role_name="test") |
|
|
|
|
|
|
|
|
# Get all roles for the realm or client |
|
|
# Get all roles for the realm or client |
|
|
realm_roles = keycloak_admin.get_roles() |
|
|
realm_roles = keycloak_admin.get_roles() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Assign client role to user. Note that BOTH role_name and role_id appear to be required. |
|
|
|
|
|
keycloak_admin.assign_client_role(client_id=client_id, user_id=user_id, role_id=role_id, role_name="test") |