Permalink
Browse files

Initial commit.

0 parents commit 4f21289639d9598d6bf817381862d171e094b2f5 Torbjorn Tornkvist committed Jan 30, 2009
@@ -0,0 +1,7 @@
+
+all:
+ (cd src;$(MAKE))
+
+clean:
+ (cd src;$(MAKE) clean)
+
29 README
@@ -0,0 +1,29 @@
+Hi,
+
+This is 'eldap', the Erlang LDAP library.
+
+It exports an API that can do all possible operations
+you may want to do against an LDAP server. The code has
+been tested to work at some point, but only the bind
+and search operations are running daily in our (Nortel's)
+products, so there may be bugs lurking in some parts of
+the code.
+
+In the doc/README.example you'll find a trace from a
+Erlang shell session as an example on how to setup a
+connection, authenticate (bind) and perform a search.
+Note that by using the option {ssl, true}, you should
+be able to setup an SSL tunnel (LDAPS) if your Erlang
+system has been configured with SSL.
+
+In the test directory there are some hints and examples
+on how to test the code and how to setup and populate
+an OpenLDAP server. The 'eldap' code has been tested
+agains OpenLDAP, IPlanet and ActiveDirectory servers.
+
+If you plan to incorporate this code into your system
+I suggest that you build a server/supervisor harnesk
+that uses 'eldap' (as we have done in our products).
+
+Good luck !
+/Tobbe
@@ -0,0 +1,44 @@
+1> {_,S} = eldap:open(["192.168.128.47"], []).
+{ok,<0.30.0>}
+2> eldap:simple_bind(S,"cn=Torbjorn Tornkvist,cn=Users,dc=bluetail,dc=com","qwe123").
+ok
+3> Base = {base, "dc=bluetail,dc=com"}.
+{base,"dc=bluetail,dc=com"}
+4> Scope = {scope, eldap:wholeSubtree()}.
+{scope,wholeSubtree}
+5> Filter = {filter, eldap:equalityMatch("sAMAccountName", "tobbe")}.
+{filter,{equalityMatch,{'AttributeValueAssertion',"sAMAccountName","tobbe"}}}
+6> Search = [Base, Scope, Filter].
+[{base,"dc=bluetail,dc=com"},
+ {scope,wholeSubtree},
+ {filter,{equalityMatch,{'AttributeValueAssertion',"sAMAccountName","tobbe"}}}]
+7> eldap:search(S, Search).
+{ok,{eldap_search_result,[{eldap_entry,
+ "CN=Torbjorn Tornkvist,CN=Users,DC=bluetail,DC=com",
+ [{"manager",
+ ["CN=Tord Larsson,CN=Users,DC=bluetail,DC=com"]},
+ {"memberOf",
+ ["CN=TestGroup2,CN=Users,DC=bluetail,DC=com",
+ "CN=TestGroup,CN=Users,DC=bluetail,DC=com",
+ "CN=Pre-Windows 2000 Compatible Access,CN=Builtin,DC=bluetail,DC=com",
+ "CN=Server Operators,CN=Builtin,DC=bluetail,DC=com"]},
+ {"accountExpires",["0"]},
+ {"adminCount",["1"]},
+ {"badPasswordTime",["127119104851642448"]},
+ {"badPwdCount",["0"]},
+ {"codePage",["0"]},
+ {"cn",["Torbjorn Tornkvist"]},
+ {"company",["Alteon Web Systems"]},
+ {"countryCode",["0"]},
+ {"department",["Bluetail"]},
+ {"displayName",["Torbjorn Tornkvist"]},
+ {"mail",["tobbe@bluetail.com"]},
+ {"givenName",["Torbjorn"]},
+ {"instanceType",["4"]},
+ {"lastLogoff",["0"]},
+ {"lastLogon",["127119109376267104"]},
+ {"logonCount",[...]},
+ {"msNPAllowDialin"|...},
+ {...}|...]}],
+ [["ldap://bluetail.com/CN=Configuration,DC=bluetail,DC=com"]]}}
+8>
Oops, something went wrong.

0 comments on commit 4f21289

Please sign in to comment.