\ /
NGMS  Case study  Migration 

Active Directory Migration with Keycloak

Migrazione di Active Directory con Keycloak

[Versione italiana di seguito]

Disclaimer: Many of our customers have confidentiality agreements safeguarding their brand names from commercial purposes. Hence, you may encounter references such as “Client name confidential”, or the customer’s industry instead of the customer’s brand name.


Popular Italian luxury brand, uses Keycloak as a Single Sign-On tool. Keycloak inherits and synchronizes users from an Active Directory, this harmony allows simple and secure access to company employees to many applications, almost the same system that Sorint uses.

The critical event for the customer was the migration to a new version of Active Directory, an operation that imperatively had to happen gradually and without any disruption to employees. A function of this kind, with the specificities requested by the customer, is not natively available via Keycloak but a solution absolutely had to be found.

Taking advantage of the interdisciplinarity of Sircle FULLAM, the affinity created with the customer and the experience of their infrastructure and the support of colleagues, I was able to build a script that involves 3 different technologies: SQL, LDAP and API

Without going into detail, I will summarize just a part of the operation: the migration of roles

  1. SQL query to extract a CSV with the correlations of users, roles and groups
  2. The CSV is processed inside a bash script that parameterizes the information
  3. A first API call generates the authentication token and also parameterizes this information
  4. IF - ELSE - FI makes a matching with the information collected, to identify who has been migrated and who has not. If they have not migrated, they do not proceed with any action, otherwise they continue.
  5. The next check involves inserting the filtered users into an LDAP query, which will return confirmation if it is present in the new Active Directory of the customer
  6. We return to interact with the Keycloak APIs, first with a GET for a check and then with a POST inserting the information obtained in the initial CSV to the correct users

It is a really cumbersome process but it works and is still doing its job today!

Full-AM and therefore Sorint.Lab has completed an entirely custom integration efficiently and in a short time, guaranteeing continuity of service to end users and therefore customer satisfaction

Written by: Michela Bonizzi


Avviso: Molti dei nostri clienti hanno stipulato accordi di riservatezza che tutelano i loro marchi da scopi commerciali. Pertanto potresti incontrare diciture come “Nome cliente riservato” oppure vedrai riportato il settore del cliente invece del suo nome.

Popolare brand del lusso Italiano, utilizza Keycloak come strumento di Single Sign-On. Keycloak eredita e sincronizza le utenze da un Active Directory, questa sintonia, permette il semplice e sicuro accesso ai dipendenti dell'azienda a molti applicativi, quasi lo stesso sistema che utilizza Sorint.

L'evento critico per il cliente è stata la migrazione ad una nuova versione di Active Directory, operazione che imperativamente doveva avvenire gradualmente e senza alcun disservizio ai dipendenti. Una funzione del genere, con le specificità richieste dal cliente, non è nativamente disponibile tramite Keycloak ma assolutamente una soluzione doveva essere trovata.

Sfruttando la interdisciplinarità del Sircle FULLAM, l'affinità creata con il cliente e l'esperienza della loro infrastruttura ed il supporto dei colleghi sono riuscita a costruire un script che coinvolge ben 3 tecnologie diverse: SQL, LDAP e API

Senza dilungarmi in dettagli riassumo solo una parte del funzionamento: la migrazione dei ruoli

  1. Query SQL per estrarre un CSV con le correlazioni di utenti, ruoli e gruppi
  2. Il CSV viene processato dentro uno script di bash che parametrizza le informazioni
  3. Una prima chiamata API genera il token di autenticazione e parametrizza anche questa informazione
  4. IF - ELSE - FI fa un matching con le informazioni raccolte, per individuare chi è stato migrato e chi no, Se non è migrato, non procede con alcuna azione, altrimenti continua.
  5. Il prossimo controllo prevede di inserire le utenze così filtrate in una query LDAP, che restituirà la conferma se è presente nel nuovo Active Directory del cliente
  6. Si ritorna ad interagire con le API di Keycloak, prima con una GET per un controllo e successivamente con una POST inserendo le informazioni ottenute nel CSV iniziale agli utenti corretti

È un giro veramente macchinoso ma funziona e sta' ad oggi ancora facendo il suo lavoro !

Full-AM e dunque Sorint.Lab ha concluso una integrazione interamente custom efficientemente ed in tempi brevi garantendo una continuità di servizio agli utenti finali e quindi la soddisfazione del cliente

Autrice: Michela Bonizzi

comments powered by Disqus