You'll need both docker-machine and docker-compose on your machine.
Before running the docker, please ensure that any service are running on both port 80 and 389 of your host machine.
$ docker-compose build
$ docker-compose up
# daemon mode
$ docker-compose up -d
At this point you can check the running container with
$ docker ps -a
You can get the phpLDAPadmin IP by running :
$ docker inspect -f "{{.NetworkSettings.Networks.dockerldapphp_default.IPAddress}}" ldapphp_phpldapadmin_1
You can then access the phpLDAPadmin at https://$IP_LDAP and log with those credentials :
Login DN | Password |
---|---|
cn=admin,dc=example,dc=org | admin |
You can load the ldap entries this way :
11:00:17 ❯ docker exec -it dockerldapphp_ldap_1 ldapadd -x -D "cn=admin,dc=example,dc=org" -w admin -H ldap:// -f /ldap_entries/add_content.ldif
You can then update the password for a specific user from the phpldapadmin interface !
All php code present in the ./src
directory can be reached on localhost
or 127.0.0.1
LDAPHelper.php
is a simple class that wrap the interaction with the LDAP.
HandleForm.php
is a simple php code that try to authentificate a user with the data from a request trough the LDAPHelper
class.
index.html
is a simple html form that redirect to the HandleForm.php
file. Reach it at 127.0.0.1/index.html
.
You can then authenticate into the ldap with those value :
host | ldap_dn | group | username | password |
---|---|---|---|---|
your ldap host | dc=example,dc=org | cn=admin | admin | |
your ldap host | dc=example,dc=org | ou=People | uid=john | password set in previous step |
You can stop the stack by running :
$ docker-compose stop
You can remove the stack by running :
docker-compose down
First of all, thank you for contributing
If you find any typo/misconfiguration/... please send me a PR or open an issue. You can also ping me on twitter.
Also, while creating your Pull Request on GitHub, please write a description which gives the context and/or explains why you are creating it.