Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executable plugin broken when using binaryAttribute as pivot #3

Open
coudot opened this issue Jan 19, 2017 · 0 comments
Open

Executable plugin broken when using binaryAttribute as pivot #3

coudot opened this issue Jan 19, 2017 · 0 comments
Labels
Milestone

Comments

@coudot
Copy link
Member

coudot commented Jan 19, 2017

From http://tools.lsc-project.org/issues/766

I am using the executable plugin as a destination service and am syncing from active directory. I am trying to use objectGUID as the pivot attribute. For example, on a particular LDAP entry, an LDAP search of active directory returns:

objectGUID:: awOS8elHDEiszxWm8l1aPA==

But, when I run LSC, the following is sent to my script:

objectguid:: awPvv73vv73vv71HDEjvv73vv70V77+977+9XVo8

I was able to fix the issue by modifying AbstractExecutableLdifService.java and changing the toLdif method. I changed the following line:

LdifLayout.printAttributeToStringBuffer(sb, attributeName, Collections.singletonList((Object)attributes.getStringValueAttribute(attributeName)));

to:

LdifLayout.printAttributeToStringBuffer(sb, attributeName, new ArrayList<Object>(attributes.getDatasets().values()));

I am fairly new to LDAP and LSC, so I am not sure if this breaks other things, but the proper string is now passed to my script...

Here is my connection information:

        <ldapConnection>
            <name>ldap-src-conn</name>
            <url>ldap://%LDAP_HOST%:%LDAP_PORT%/%LDAP_BASE_DN%</url>
            <username>%LDAP_USERNAME%</username>
            <password>%LDAP_PASSWORD%</password>
            <authentication>SIMPLE</authentication>
            <referral>IGNORE</referral>
            <derefAliases>NEVER</derefAliases>
            <version>VERSION_3</version>
            <pageSize>-1</pageSize>
            <factory>com.sun.jndi.ldap.LdapCtxFactory</factory>
            <tlsActivated>false</tlsActivated>
            <binaryAttributes>
                <string>objectguid</string>
            </binaryAttributes>
        </ldapConnection>

        <pluginConnection>
            <name>executable</name>
            <url>fake</url>
            <username>fake</username>
            <password>fake</password>
            <binaryAttributes>
                <string>objectguid</string>
            </binaryAttributes>
        </pluginConnection>
    </connections>

Here is my ldap source service:

            <ldapSourceService>
                <name>groups-source-service</name>
                <connection reference="ldap-src-conn" />
                <baseDn>%LDAP_BASE_DN%</baseDn>
                <pivotAttributes>
                    <string>objectguid</string>
                </pivotAttributes>
                <fetchedAttributes>
                    <!--<string>objectGUID</string>-->
                    <string>name</string>
                </fetchedAttributes>
                <getAllFilter>(&amp;(objectClass=group))</getAllFilter>
                <getOneFilter>(&amp;(objectClass=group)(objectGUID={objectGUID}))</getOneFilter>
                <cleanFilter>(&amp;(objectClass=group)(objectGUID={objectGUID}))</cleanFilter>
            </ldapSourceService>
@coudot coudot added the bug label Jan 19, 2017
@coudot coudot added this to the 1.1 milestone Jan 19, 2017
@coudot coudot modified the milestones: 1.1, 1.2 Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant