Hi,
Do you want to propagate users to an external SQL database right?
Which version of Syncope are you running?
Il 10/08/2018 11:52, d.cheremnov ha scritto:
Hi!
1.
Activiti DataBase:
CREATE TABLE IF NOT EXISTS `act_id_user` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`FIRST_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`LAST_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`EMAIL_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PWD_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`PICTURE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE IF NOT EXISTS `act_id_group` (
`ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`REV_` int(11) DEFAULT NULL,
`NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE IF NOT EXISTS `act_id_membership` (
`USER_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
`GROUP_ID_` varchar(64) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`USER_ID_`,`GROUP_ID_`),
KEY `ACT_FK_MEMB_GROUP` (`GROUP_ID_`),
CONSTRAINT `ACT_FK_MEMB_GROUP` FOREIGN KEY (`GROUP_ID_`) REFERENCES
`act_id_group` (`ID_`),
CONSTRAINT `ACT_FK_MEMB_USER` FOREIGN KEY (`USER_ID_`) REFERENCES
`act_id_user` (`ID_`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
2.
ActivitiUserDBConnector (users, 'table' connector):
https://gyazo.com/e13dda814cf587deb116a4a344faffe1
3. __ACCOUNT__ provision rules (users resource):
https://gyazo.com/387f96a1a4ef597fdb67bc2859d0451e
4.
I added 2 users on the syncode and do Push:
https://gyazo.com/421bdd80f3089c14d8856c4e4f7f8bfb
Question:
1. How to export 'password' field to `act_id_user` table ?
Please take a look at [1]. Especially to commented description:
"password: password string, clear text".
N.B. If you want to enable cleartext passwords please flag
clearTextPasswordToScript in connector configuration.
2. Exists groups. I can export the groups to `act_id_group` table, use
'scriptedsql' connector?
Yes you can. By properly managing objectClass in Groovy script.
3. How to export an 'user-group' membership to `act_id_membership` table?
You need a custom PropagationActions, something like [2].
In this custom action you have to implement the "before" method where
you can, for example, create your own connid attribute to pass to groovy
scripts, say __MEMBERSHIPS__. In __MEMBERSHIPS__ you can pass list of
the groups of the user and then use this attribute in the groovy script
(see examples in the code at [1]) in order to populate act_id_membership
table.
--
Sent from: http://syncope-user.1051894.n5.nabble.com/
HTH,
Andrea
[1]
https://github.com/apache/syncope/blob/2_0_X/fit/core-reference/src/test/resources/scriptedsql/CreateScript.groovy
[2]
https://github.com/apache/syncope/blob/2_0_X/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/LDAPMembershipPropagationActions.java
--
Dott. Andrea Patricelli
Tel. +39 3204524292
Developer @ Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 0859111173
http://www.tirasa.net
Apache Syncope PMC Member