Hi,

Thanks for such quick example. For now I'm not so familiar with term
"mainIdentifier". I've read the documentation, this is something which is
directly related with the selection of pivot attribute?
I mean in the mainIdentifier section, the name of pivot attribute should be
defined normally? Also you're showing "ldap" in the calling the sample
script. ldap is some already existing "object" which can be used against
the LDAP target settings?
Or is just your example, and we also should develop own "ldap" object with
some anothe java script?
Anyway, I don't how this will react if e.g. we manually move on AD user
object in the AD management tool and DN is changed?
Is this something that we should be careful in the mainIdentitfier section
and not to hardcode such values, regarding proper ou=XXX structure?
Sorry, if I'm asking to much, but before some next steps I want to be clear
what some section do in the LSC.XML and what is the real purpose.

Regards,
Matjaž

V V čet., 6. sep. 2018 ob 15:21 je oseba Clément OUDOT <
[email protected]> napisala:

>
>
> Le 06/09/2018 à 15:00, Matjaz Premerl a écrit :
> > Hi,
> >
> > Last days I'm playing around with the LSC tool with the defined sample
> > folder. What about the information for username which is mandatory to
> > have e.g. samAccountName in Active Directory. This information is not
> > nornally generated in some HR application. Is there any known approach
> > how to do this properly using LSC, to properly avoid conflicts with
> > e.g. existing user like "johnsmith", how and where in the process I
> > need to achieve e.g. "johnsmith1", etc.
> >
>
> Good question. You can write some javascript that will search on
> destination LDAP if the login already exists, and adapt it.
>
>
> Code example:
>
> function getUid(dstLdap, firstname, lastname, employeeid) {
>
>     var uid = "";
>     var uidTest = "";
>
>     firstname = normalizeString(firstname).toLowerCase();
>     lastname = normalizeString(lastname).toLowerCase();
>
>
>         for ( var i = 0; i < firstname.length(); i++ ){
>              uidTest = lastname + firstname.substr(0,i+1);
>              if (
>
> dstLdap.search("ou=users","(&(!(employeeNumber="+employeeid+"))(uid="+uidTest+"))"
> ) == "[]" ) {
>                  uid = uidTest;
>                  break;
>              }
>         }
>
>     return uid;
> }
>
> That can be called in lsc.xml:
>
>         <mainIdentifier>js:"uid=" + getUid(ldap,
> srcBean.getDatasetFirstValueById("FIRSTNAME"),
> srcBean.getDatasetFirstValueById("LASTNAME"),
> srcBean.getDatasetFirstValueById("EMPLOYEEID")) +
> ",ou=users,dc=example,dc=com"</mainIdentifier>
>
>
>
> See also https://lsc-project.org/documentation/latest/scripting/start
>
> --
> Clément Oudot | Identity Solutions Manager
>
> [email protected]
>
>
> Worteks | https://www.worteks.com
>
> _______________________________________________________________
> Ldap Synchronization Connector (LSC) - http://lsc-project.org
>
> lsc-users mailing list
> [email protected]
> https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users

Reply via email to