Wire up required actions correctly

This commit is contained in:
decentral1se 2021-06-18 09:14:35 +02:00
parent f99d069d61
commit ad8aa8a5ba
Signed by: decentral1se
GPG Key ID: 92DAD76BD9567B8A

View File

@ -56,15 +56,12 @@ for email in emails:
"realmRoles": [ "realmRoles": [
"user_default", "user_default",
], ],
"requiredActions": ["UPDATE_PASSWORD", "UPDATE_PROFILE"],
} }
try: try:
user_id = keycloak.create_user(payload, exist_ok=False) user_id = keycloak.create_user(payload, exist_ok=False)
print(f"Account created for {email}") print(f"Account created for {email}")
keycloak.send_update_account(
user_id=user_id, payload=json.dumps(["UPDATE_PASSWORD", "UPDATE_PROFILE"])
)
print(f"UPDATE_PASSWORD/PROFILE actions set for {email}")
keycloak.send_verify_email(user_id=user_id) keycloak.send_verify_email(user_id=user_id)
print(f"Verification mail sent to {email}") print(f"Verification mail sent to {email}")
except Exception as exception: except Exception as exception: