You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on 'rroemhild' Docker LDAP Testing Server Repo
Usage
# Docker Image:
docker pull bostongov/ldap-sampling
docker run --privileged -d -p 389:389 bostongov/ldap-sampling
# OR# Repo: Use this method if you plan on running the node server
git clone [email protected]:CityOfBoston/ldap-sampling.git
# cd into the directory
docker build -t ldap-mock-1 --no-cache .&& docker run --privileged -d -p 389:389 --name ldap-mock-1 ldap-mock-1
Requests
# Search on `CN`
ldapsearch -x -H ldap://localhost:388 -b "dc=boston,dc=cob"'(cn=000296)'# The request above request all and filters by the provided 'cn'# ----# filter: (cn=000296)# requesting: ALL# ----# -b basedn base dn for search: "dc=boston,dc=cob"# Add User
ldapadd -x -D cn=admin,dc=boston,dc=cob -H ldap://localhost:388 -w 'GoodNewsEveryone'<<!dn: cn=Celes Chere, cn=Internal Users,dc=boston,dc=cobobjectClass: inetorgpersonobjectClass: topobjectClass: organizationalPersonobjectClass: personemployeetype: Full-Timemail: [email protected]sn: Cheregivenname: Celescn: Celes Chereuid: Celes Chere!# Binding DN: 'cn=admin,dc=boston,dc=dob'# Group/Ldap Password: -w 'GoodNewsEveryone'# Fields between <<! and ! set the entries attributes# Modify Group, add new member 'uniqueMember'
ldapmodify -x -D cn=admin,dc=boston,dc=cob -H ldap://localhost:388 -w 'GoodNewsEveryone'<<!dn: cn=ANML02_LostFound,cn=Lagan_Groups,cn=Groups,dc=boston,dc=cobchangetype: modifyadd: uniquememberuniquemember: cn=132367,cn=Internal Users,dc=boston,dc=cob!
LDAP JS
We use ldapjs to interact with the Active Directory System we just stood up with Docker. We use Hapi.js to standup a node web server at http://localhost:8000. These are some of the commands that can be run against ldapjs to fetch and modify Groups.