问题
I'm attempting to access an LDAP directory from devices that do not natively support the protocol. I want to be able to send requests via HTTP actions, run LDAP queries, and return the results in JSON. I attempted to do this via a Node.js server that acts like an LDAP client. You can view the Gist here.
A few questions:
Is this even possible?
What are some best practices for authentication?
Thank you!
回答1:
Writing a custom http-to-whatever
bridge is always possible as long as your stack supports both - http
and whatever
.
You may have a look at opendj-rest2ldap-servlet which provides a generic LDAP-HTTP/REST bridge. Some version of the source code available at: https://svn.forgerock.org/opendj/trunk/opendj/opendj-rest2ldap/
回答2:
Yes, it's possible, but not necessarily with node.js. I did it by writing a Java Servlet that accepts the appropriate request parameters, does the LDAP lookup accordingly, and writes back whatever you need as HTML.
I did this for serving up jpegPhoto
attributes as images.
来源:https://stackoverflow.com/questions/31236761/accessing-an-ldap-directory-via-http