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

Get SRC CN from SRC mail #271

Open
seesoe opened this issue Mar 31, 2024 · 1 comment
Open

Get SRC CN from SRC mail #271

seesoe opened this issue Mar 31, 2024 · 1 comment
Labels

Comments

@seesoe
Copy link

seesoe commented Mar 31, 2024

I'm trying to get the CN of a user by looking them up by mail in the source OpenLDAP connection. I have the following start of code but I'm not sure what steps I'm missing. I couldn't find enough documented method names to get this figured out. srcDn is returning null.

<dataset>
    <name>man</name>
    <policy>FORCE</policy>
    <forceValues>
        <string>
        <![CDATA[rjs:
            var output = ',CN=Users,DC=ad,DC=mydomain,DC=com';
            var srcDn = ldap.search("ou=users", "(mail= + srcBean.getDatasetFirstValueById("manEmail") + )");
            var srcCn = srcLdap.attribute(srcDn, "cn").get(0);
            output = 'CN=' + srcCn + output
            output
        ]]>
        </string>
    </forceValues>
</dataset>
@coudot
Copy link
Member

coudot commented May 28, 2024

Indeed our documentation on the subject is not very clear.

You can refer to this javadoc: https://lsc-project.org/javadoc/latest/org/lsc/jndi/ScriptableJndiServices.html

And also look at some samples like: https://lsc-project.org/documentation/latest/synchronizegroups.html#member

Feek free to open a issue, and even better, a pull request, to improve the documentation on https://github.com/lsc-project/documentation

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

2 participants