On day one of an acquisition, employees from both entities must be able to collaborate. However, directory consolidation is historically fraught with permission issues, broken auth flows, and manual IT bottlenecks. Here is how we automated directory consolidation for 15,000 users using custom Python tools interfacing with Okta.
Designing the Sync Architecture
Rather than performing a destructive one-way migration, we built an automated synchronization bridge. This allowed employees to keep their historical credentials while gaining federated access to shared corporate workspaces.
import okta.client as okta_client
async def sync_user_groups(client, source_user_id, target_user_id):
# Fetch source groups
groups, resp, err = await client.list_user_groups(source_user_id)
if err:
raise Exception(f"Failed to fetch source groups: {err}")
for group in groups:
if "Enterprise-Shared-" in group.profile.name:
# Assign user to target corporate tenant group
await client.add_user_to_group(group.id, target_user_id)
print(f"Associated target user with security group: {group.profile.name}")This automated process ensured that user directories synced every 15 minutes, ensuring that role transitions and onboardings were completed smoothly without manual ticket intervention.
ulil albab
Technical M&A Lead & Infrastructure Architect
💬 Ask me about How to increase productivity, dealing with repetitive jobs and project management.