Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| tutorial:adm:connect_a_db_system [2024/04/15 09:43] – [Systems - DB: Source of identities] cem | tutorial:adm:connect_a_db_system [2026/06/05 06:46] (current) – translation to EN - TODO images not working still kopro | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Systems - DB: Source of identities ====== | + | {{tag> tutorial system synchronization database connector identity sync}} |
| + | ====== Systems - DB: Source of identities ====== | ||
| ===== Basic configuration ===== | ===== Basic configuration ===== | ||
| Line 6: | Line 7: | ||
| This tutorial deals with how to connect an authoritative (primary) system as a source of identities. To this end, the basic Database Table Connector will come in handy. The source table we are going to use consists of 4 columns: id, username, first name, and last name. | This tutorial deals with how to connect an authoritative (primary) system as a source of identities. To this end, the basic Database Table Connector will come in handy. The source table we are going to use consists of 4 columns: id, username, first name, and last name. | ||
| - | First, click on the **Add** button on the //Systems// tab item. Pick a system name, say, //Some base//. Check the ReadOnly checkbox field – your database is to serve as a source of data only, you don't actually wish to be able to write to it. Keep other attributes of the system as they are by default. Then click on the **Save and continue** button. | + | First, click on the <label type=" |
| ==== Connector configuration ==== | ==== Connector configuration ==== | ||
| - | Go to the // | + | Go to the // |
| + | * Host = `localhost` - the DB runs on the same server as IdM | ||
| + | * Port = `5432` - the standard port for PostgreSQL | ||
| + | * User = `idmadmin` - a previously created DB user with sufficient permissions to read the data | ||
| + | * User Password = < | ||
| + | * Table = `users` - we have prepared a table named //users// in the DB, from which we are going to synchronize users into CzechIdM | ||
| + | * Key Column = `id` - the //Database Table Connector (connId)// requires you to explicitly mark the column which is used as a unique identifier in the DB. Typically, this is the primary key of the table. | ||
| + | * JDBC Connection URL = '' | ||
| + | * JDBC Driver = '' | ||
| - | <note important> | + | At the time of writing this tutorial, the driver for PostgreSQL can be downloaded here: [[https:// |
| + | Apart from the settings in the system configuration in CzechIdM, the driver file must be placed into the library location of the application server. In our case, CzechIdM runs on the Tomcat application server, so we place the driver into the //lib// folder. Alternatively, | ||
| - | * Host = localhost – DB nám běží na stejném serveru jako IdM | + | Leave the other connector attributes empty or with their default pre-filled values. |
| - | * Port = 5432 – standardní port pro PostgreSQL | + | |
| - | * User = idmadmin – dříve vytvořený uživatel v DB s dostatečným oprávněním na čtení dat | + | |
| - | * User Password = %%**%%%%**%%* | + | |
| - | * Table = users – v DB jsme si předpřipravili tabulku s názvem // | + | |
| - | * Key Column = id - //Database Table Connector (connId)// | + | |
| - | * JDBC Connection URL = // | + | |
| - | * JDBC Driver = org.postgresql.Driver – konektor podporuje více různých typů relačních databází. V našem případě napojujeme DB PostgreSql. Pro napojení je třeba v CzechIdM nastavit ovladač, který zajistí operace s daným typem databáze. | + | |
| - | V době psaní tohoto návodu lze driver pro PostgreSql stáhnout zde https:// | + | If everything has been set correctly and CzechIdM can access our DB, we can verify the configuration by clicking on the green <label type=" |
| - | Kromě nastavení v konfiguraci systému v CzechIdM je potřeba soubor s ovladačem umístit do umístění pro knihovny aplikačního serveru. V našem případě běží CzechIdM v AS Tomcat, tedy driver umístíme do složky //lib//. Případně můžeme umístit driver do WEB-INF/lib přímo v umístění aplikace CzechIdM. | + | ==== System schema ==== |
| - | Ostatní atributy konektoru necháme nevyplněné nebo s výchozí předvyplněnou hodnotou. | + | {{: |
| - | Pokud jsme vše správně nastavili a CzechIdM má přístup do naší DB, můžeme konfiguraci ověřit kliknutím na zelené tlačítko | + | Go to the //System schema// tab (described in chapter 2.3.2 FIXME) and click on the <label type=" |
| - | ==== Schéma DB systému ==== | + | In addition, the connector returned the < |
| - | {{: | + | By clicking on the magnifier icon next to the attribute name, you can display the configuration details of the particular attribute. |
| - | Navíc nám konektor ale vrátil atribut %%__%%NAME%%__%%, | + | {{:Pictures/100000000000017D0000023659372405B77FE7FF.png? |
| - | Kliknutím na lupu vedle názvu atributu je možné zobrazit detaily konfigurace pro konkrétní atribut. | + | In our case, all the attributes have the same configuration except for the `id` and < |
| - | {{: | + | ==== Synchronization mapping for the DB ==== |
| - | Obrázek 22: Detail atributu ve schématu systému}} | + | |
| - | V našem případě mají všechny atributy stejnou konfiguraci až na atribut id a %%__%%NAME%%__%%, které jsou označeny jako povinné. | + | Once the system schema is ready, we can proceed to the synchronization mapping. It allows us to define which attributes from the available schema will be synchronized into IdM, and also which Identity attributes will be filled with the attributes from the account. |
| - | ==== Mapování synchronizace pro DB ==== | + | On the //Attribute mapping// tab, click on the <label type=" |
| - | Máme-li připravené schéma systému, pak přikročíme k mapování synchronizace. To nám umožní určit, jaké atributy z dostupného schématu nasynchronizujeme do IdM a také do kterých atributů | + | * Operation type = Synchronization |
| + | * Mapping name = `users` | ||
| + | * Object name = < | ||
| + | * IdM entity type = Identity | ||
| - | Na záložce | + | {{:Pictures/10000000000002DA000000DD52F875E7D80B2EDD.png? |
| - | * Typ operace = Synchronizace | + | After creating the mapping, open its detail and set the particular bindings of the account attributes to the identity attributes. Set the mapping for all our attributes: `id`, `name`, `surname`, `username`. |
| - | * Název mapování = users – naše označení této sychronizace. Systém může mít více různých synchronizací. | + | |
| - | * Název objektu = %%__%%ACCOUNT%%__%% - typ objektu, který chceme synchronizovat. | + | |
| - | * {{:Pictures/ | + | |
| - | Po vytvoření mapování klikneme na detail tohoto mapování a nastavíme konkrétní vazby atributů účtu na atribut identity. Nastavíme mapování pro všechny naše atributy id, name, surname, username. | + | {{: |
| - | {{: | + | For example, the `id` attribute is set according to the picture above. The other attributes are set the same way, except for the following items: |
| - | * //Je identifikátorem//, | + | * //Is identifier// - checked only for `id`. |
| - | * Atribut | + | * Entity attribute - says that the attribute from the system will be mapped to a basic attribute of the entity |
| - | * IdM klíč – definuje který atribut | + | * IdM key - defines which entity |
| - | Jak je vidět, ne všechny atributy musíme mapovat na atribut v CzechIdM. | + | As you can see, not all attributes have to be mapped to an attribute in CzechIdM. |
| - | V našem příkladu jsme namapovali atributy účtu na systému na základní atributy | + | In our example, we mapped the account attributes on the system to the basic Identity |
| {{: | {{: | ||
| - | ==== | + | ==== Synchronization settings |
| + | |||
| + | In the previous chapter, we prepared the attribute mapping for the synchronization. Now we will set up the synchronization process itself, which will use this mapping. | ||
| + | |||
| + | {{: | ||
| - | V předchozí kapitole jsme si připravili mapování atributů pro synchronizaci. Nyní nastavíme samotný proces synchronizace, který toto mapování bude používat. | + | Go to the // |
| - | {{:Pictures/ | + | Then proceed in the form to the settings of operations for the individual account and entity states and set them as follows: |
| - | Dále přejdeme ve formuláři až k nastavení operací pro jednotlivé stavy účtu a entity a nastavíme následujícím způsobem: | + | * Link exists, action = Update entity - This ensures that on repeated synchronization runs, when the //account (end system)// - //identity (CzechIdM)// |
| + | * Link does not exist, correlation attribute = `id`, action = Create link - This ensures that on repeated runs, all //accounts and entities// with the same `id` will be linked together. | ||
| + | * Entity does not exist, action = Create entity - This ensures that on every run, entities which did not exist in CzechIdM until then will be created according to the accounts on the system. | ||
| + | * Account does not exist, action = Ignore - We do not want to perform any action when an entity | ||
| - | * Vazba existuje, akce = Aktualizovat entitu – Tím zajistíme, že při opakovaném běhu synchronizace, | + | Leave the Workflow items empty - they are used for advanced scripting of the individual actions. |
| - | * Vazba neexistuje, korelační atribut = id, akce = Vytvořit vazbu – Tím zajistíme, že při opakovaných bězích se prolinkují všechny //účty a entity//, které mají stejné //id.// | + | |
| - | * Entita neexistuje, akce = vytvořit entitu | + | |
| - | * Účet neexistuje, akce = Ignorovat – Nechceme provádět žádnou akci, pokud existuje entita v IdM a účet neexistuje. Systém je pro nás pouze zdroj dat. | + | |
| - | Položky Workflow necháme nevyplněny, ty slouží pro pokročilé skriptování u jednotlivých akcí. | + | On the Filter sub-tab, we do not set anything - we do not want to restrict the synchronization to only some accounts. The Logs tab is informative only and contains the audit log of the synchronization. |
| - | Na podzáložce Filtr nenastavujeme nic, nechceme omezovat synchronizaci pouze na některé účty. A záložka Logy je pouze informativní a obsahuje auditní | + | ==== Starting the synchronization and the log ==== |
| - | ==== Spuštění synchronizace a log ==== | + | If we have successfully gone through the settings in the previous chapters, we can now proceed to starting the Synchronization itself. Go to the //Connected systems// tab, select our configured system and go to the Synchronization tab. Start the synchronization with the green triangle button at the end of the row with the synchronization configuration. |
| - | Pokud jsme úspěšně prošli nastavením v předchozích kapitolách, | + | {{:Pictures/10000201000002C7000001BCD31C6120982EF7E6.png? |
| - | {{:Pictures/10000201000002C7000001BCD31C6120982EF7E6.png? | + | Running synchronizations have the //Running// column filled in. If you open the detail |