Thank you for your comments, they have been very helpful.
I actually found a ldap python library online and a few helpful scripts which helped me write a python script that returns the info I need, my only confusion now is reformatting the xml file into the correct alfred format.
Here's my script:
#!/usr/local/bin/python
import ldap, sys
if __name__ == "__main__":
ldap_server="ldap_server"
username = "username"
password= "password"
# the following is the user_dn format provided by the ldap server
user_dn = "uid="+username+",ou=people,dc=ex,dc=com"
# adjust this to your base dn for searching
base_dn = "dc=ex,dc=com"
connect = ldap.open(ldap_server)
search_filter = "uid="+username
try:
#if authentication successful, get the full user data
connect.bind_s(user_dn,password)
retrieveAttributes = ["mail", "telephoneNumber", "cn"]
result = connect.search_s(base_dn,ldap.SCOPE_SUBTREE,search_filter,retrieveAttributes)
# return all user data results
connect.unbind_s()
sys.stdout = open('/tmp/ldapres.xml', 'r+')
print result
except ldap.LDAPError:
connect.unbind_s()
print "authentication error"
and here is my xml file:
[('uid=username, ou=people, dc=ex, dc=com', {'telephoneNumber': ['+1 111 111 1111'], 'mail': ['email'], 'cn': ['full name']})]
Any ideas on how to get this into the format alfred needs to display it correctly would be super helpful.
I've replaced my specific login info and output with generics
Thanks!