Prepopulated OpenLDAP server for testing
396
This fork adds more LDAP groups and more tools to the Docker container.
This image provides an OpenLDAP Server for testing LDAP applications, i.e. unit tests. The server is initialized with the example domain planetexpress.com with data from the Futurama Wiki.
Parts of the image are based on the work from Nick Stenning docker-slapd and Bertrand Gouny docker-openldap.
The Flask extension flask-ldapconn use this image for unit tests.
docker pull alchen99/test-openldap
docker run --privileged -d -p 389:389 alchen99/test-openldap
| Admin | Secret |
|---|---|
| cn=admin,dc=planetexpress,dc=com | GoodNewsEveryone |
| Attribute | Value |
|---|---|
| objectClass | inetOrgPerson |
| cn | Hubert J. Farnsworth |
| sn | Farnsworth |
| description | Human |
| displayName | Professor Farnsworth |
| employeeType | Owner |
| employeeType | Founder |
| givenName | Hubert |
| jpegPhoto | JPEG-Photo (630x507 Pixel, 26780 Bytes) |
| [email protected] | |
| [email protected] | |
| ou | Office Management |
| title | Professor |
| uid | professor |
| userPassword | professor |
| Attribute | Value |
|---|---|
| objectClass | inetOrgPerson |
| cn | Philip J. Fry |
| sn | Fry |
| description | Human |
| displayName | Fry |
| employeeType | Delivery boy |
| givenName | Philip |
| jpegPhoto | JPEG-Photo (429x350 Pixel, 22132 Bytes) |
| [email protected] | |
| ou | Delivering Crew |
| uid | fry |
| userPassword | fry |
| Attribute | Value |
|---|---|
| objectClass | inetOrgPerson |
| cn | John A. Zoidberg |
| sn | Zoidberg |
| description | Decapodian |
| displayName | Zoidberg |
| employeeType | Doctor |
| givenName | John |
| jpegPhoto | JPEG-Photo (343x280 Pixel, 26438 Bytes) |
| [email protected] | |
| ou | Staff |
| title | Ph. D. |
| uid | zoidberg |
| userPassword | zoidberg |
| Attribute | Value |
|---|---|
| objectClass | inetOrgPerson |
| cn | Hermes Conrad |
| sn | Conrad |
| description | Human |
| employeeType | Bureaucrat |
| employeeType | Accountant |
| givenName | Hermes |
| [email protected] | |
| ou | Office Management |
| uid | hermes |
| userPassword | hermes |
| Attribute | Value |
|---|---|
| objectClass | inetOrgPerson |
| cn | Turanga Leela |
| sn | Turanga |
| description | Mutant |
| employeeType | Captain |
| employeeType | Pilot |
| givenName | Leela |
| jpegPhoto | JPEG-Photo (429x350 Pixel, 26526 Bytes) |
| [email protected] | |
| ou | Delivering Crew |
| uid | leela |
| userPassword | leela |
| Attribute | Value |
|---|---|
| objectClass | inetOrgPerson |
| cn | Bender Bending Rodríguez |
| sn | Rodríguez |
| description | Robot |
| employeeType | Ship's Robot |
| givenName | Bender |
| jpegPhoto | JPEG-Photo (436x570 Pixel, 26819 Bytes) |
| [email protected] | |
| ou | Delivering Crew |
| uid | bender |
| userPassword | bender |
Amy has a multi-valued DN
| Attribute | Value |
|---|---|
| objectClass | inetOrgPerson |
| cn | Amy Wong |
| sn | Kroker |
| description | Human |
| givenName | Amy |
| [email protected] | |
| ou | Intern |
| uid | amy |
| userPassword | amy |
| Attribute | Value |
|---|---|
| objectClass | Group |
| cn | dir_mgr |
| member | cn=admin,dc=planetexpress,dc=com |
| Attribute | Value |
|---|---|
| objectClass | Group |
| cn | admin |
| member | cn=Hubert J. Farnsworth,ou=people,dc=planetexpress,dc=com |
| member | cn=Hermes Conrad,ou=people,dc=planetexpress,dc=com |
| Attribute | Value |
|---|---|
| objectClass | Group |
| cn | crew |
| member | cn=Turanga Leela,ou=people,dc=planetexpress,dc=com |
| member | cn=Philip J. Fry,ou=people,dc=planetexpress,dc=com |
| member | cn=Bender Bending Rodríguez,ou=people,dc=planetexpress,dc=com |
| Attribute | Value |
|---|---|
| objectClass | Group |
| cn | intern |
| member | cn=Amy Wong+sn=Kroker,ou=people,dc=planetexpress,dc=com |
| Attribute | Value |
|---|---|
| objectClass | Group |
| cn | ship |
| member | cn=Hubert J. Farnsworth,ou=people,dc=planetexpress,dc=com |
| member | cn=Philip J. Fry,ou=people,dc=planetexpress,dc=com |
| member | cn=John A. Zoidberg,ou=people,dc=planetexpress,dc=com |
| member | cn=Hermes Conrad,ou=people,dc=planetexpress,dc=com |
| member | cn=Turanga Leela,ou=people,dc=planetexpress,dc=com |
| member | cn=Bender Bending Rodríguez,ou=people,dc=planetexpress,dc=com |
| member | cn=Amy Wong+sn=Kroker,ou=people,dc=planetexpress,dc=com |
Search for all groups
ldapsearch -LLL -h localhost -p 389 \
-D 'cn=admin,dc=planetexpress,dc=com' \
-w GoodNewsEveryone \
-b 'ou=people,dc=planetexpress,dc=com' \
'(&(objectclass=Group))' dn
Search for groups a user is a member of
ldapsearch -LLL -h localhost -p 389 \
-D 'cn=admin,dc=planetexpress,dc=com' \
-w GoodNewsEveryone \
-b 'ou=people,dc=planetexpress,dc=com' \
'(&(description=Human)(sn=Fry)(objectclass=inetorgperson))' dn memberof
Will result in the following:
dn: cn=Philip J. Fry,ou=people,dc=planetexpress,dc=com
memberOf: cn=ship_crew,ou=people,dc=planetexpress,dc=com
memberOf: cn=ship,ou=people,dc=planetexpress,dc=com
In case you want to use this OpenLDAP server for testing with a Java-based
application using JAAS and the LdapLoginModule, here's a working configuration
file you can use to connect.
other {
com.sun.security.auth.module.LdapLoginModule REQUIRED
userProvider="ldap://localhost/ou=people,dc=planetexpress,dc=com"
userFilter="(&(uid={USERNAME})(objectClass=inetOrgPerson))"
useSSL=false
java.naming.security.principal="cn=admin,dc=planetexpress,dc=com"
java.naming.security.credentials="GoodNewsEveryone"
debug=true
;
};
This config uses the admin credentials to connect to the OpenLDAP server and to
submit the search query for the user that enters their credentials. As username
the uid attribute of each entry is used.
Content type
Image
Digest
Size
39.2 MB
Last updated
about 6 years ago
docker pull alchen99/test-openldap