Skip to main content

Now that LDAP/Active Directory reader have been put on the deprecation list in FME 2023, I'm trying to find an out of the box solution in FME to update my workbenches and continue using it.

 

 

Hi @Jerome Alary​, unfortunately if you want to continue using deprecated formats you'll need to use a version of FME older than 2023.

I believe the LDAP reader used JDBC on the backend, so there may be the potential for you to use the JDBC Reader in FME as long as you have the LDAP JDBC drivers on your machine and have a JDBC string configured.

You can take a look into our JDBC Reader here: https://community.safe.com/s/article/using-the-generic-database-jdbc-format


I was able to use python librairy ldap3 to connect and retreive data. Also exporting the result in JSON format.

import json
import fme
import fmeobjects
import ldap3
 
class FeatureProcessor(object):
 
    def input(self, feature: fmeobjects.FMEFeature):
        server = ldap3.Server(feature.getAttribute('server'))
        # username and password from parameter
        conn = ldap3.Connection(server, FME_MacroValues>'username'], FME_MacroValuesp'password'])
        conn.bind()
        # scope attribute
        conn.search(feature.getAttribute('scope'), f'(objectClass=person)', attributes= '*'])
        
        # to a JSON object
        ad_data = conn.entries
        ad_data_json =  str(entry.entry_to_json()) for entry in ad_data]
        feature.setAttribute("ad_data_json",ad_data_json)
 
        self.pyoutput(feature)

 


Reply