Source: factory.core/ObjKeycloak.py
Represents a wrapper for Keycloak API integration that facilitates interaction
with a Keycloak server for managing users, roles, and realms.
This class is designed for managing Keycloak entities such as users, roles,
and realms. It includes functionality for token authentication, provisioning
...
| Method | Signature | Description |
|---|---|---|
| get_auth_token | get_auth_token(realm: str = 'master') |
Fetches an authentication token from Keycloak for a given realm. This method constructs a |
| connect_realm | connect_realm(realm) |
|
| provision_user | provision_user(realm: str, username: str, password: str) |
Provisions a new user in the specified realm with the provided credentials. The method |
| link_user | link_user(user: str, new_realm_uuid: str) -> None |
Links a user to a new realm by updating the database record for the specified user. |
| get_users | get_users(realm: str) -> None |
Fetches the list of users from a specified Keycloak realm and processes their |
| assign_user_role | assign_user_role(realm: str, role_name: str, user_id: str) |
Assigns a specific role to a user within a specified realm. |
| assign_user_roles | assign_user_roles(realm) |
Assigns roles to users in the provided realm. |
| provision_users | provision_users(realm: str) |
Provisions users for the specified realm by updating user records, assigning roles, |
| provision_role | provision_role(realm: str, role: str) |
Creates a new role in a specified Keycloak realm. |
| provision_roles | provision_roles(realm) |
Provisions a list of roles in the specified realm. |
Initiates the provisioning process by interacting with a Keycloak server. This