Can't import com.inductiveautomation.ignition.gateway.authentication

I want to use LDAP in a script. I’m trying the line:

from com.inductiveautomation.ignition.gateway.authentication.impl import LDAPHelper

This is mentioned in other threads, but when I run a script from the script console with it I get the error: ImportError: No module named authentication.

Do I need to run it in another scope?

Yes. The com.inductiveautomation.ignition.gateway. in the path is a clue that the class only exists in gateway scope. The script console runs on the local designer process, with a different set of dependencies.

The other question to raise is "what are you actually trying to do" - the LDAPHelper class is an internal implementation detail (subject to change between Ignition versions) and not subject to the same stability guarantees as proper system functions and first party features.

Thanks! I was trying use LDAPHelper to get emails based on first and last name. I found that we already had a user source based on our AD and can use that instead.

2 Likes