79485114

Date: 2025-03-04 23:38:09
Score: 0.5
Natty:
Report link

I solve it using partial import endpoint. This is a sample using python keycloak.

new_users = keycloak_admin.partial_import_realm(
        "realm_name",
        {
            "ifResourceExists": "FAIL",
            "users": [
                {
                    "id": "cbe0c97f-4552-4ef4-8b25-358060737016",
                    "username": "[email protected]",
                    "email": "[email protected]",
                    "enabled": True,
                    "firstName": "Example",
                    "lastName": "User",
                    "emailVerified": True,
                    "attributes": {"userRole": ["patient"]},
                    "credentials": [
                        {
                            "type": "password",
                            "value": "StrongP@ssword123",
                            "temporary": False,
                        }
                    ],
                }
            ],
        },
    )

enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Jonathan Vargas