Git Product home page Git Product logo

ldap-test-server's Introduction

ldap-test-server

This repo serves as a test LDAP server so that you quickly have a server up and ready for testing an LDAP authentication against it.

Run

# run new server
docker build -t ldap-server .
docker run --name ldap-server -p 389:389 ldap-server
# configure LDAP database
docker exec -it ldap-server /ldap-server/bin/openldap-additional-config.sh

Explore

If you'd like to explore the LDAP database you currently have, you can run phpldapadmin:

docker run -p 6443:443 --name phpldapadmin-service --hostname phpldapadmin-service --link ldap-server:ldap-host --env PHPLDAPADMIN\_LDAP\_HOSTS=ldap-host --detach osixia/phpldapadmin:0.6.8

Open up localhost:6443 and login using cn=admin,dc=example,dc=org for username and admin for password.

Sample Python

Change the host in the script below and run it in Python when you've pip install ldap3.

import ldap3
import ssl

from ldap3 import Server, Connection, ALL, NTLM, Tls

host = '192.168.99.100'

server = Server(host, use_ssl=False, get_info=ALL)
conn = Connection(server, 'cn=admin, dc=example, dc=org', 'admin', auto_bind=True)
conn.search(search_base="dc=example,dc=org", search_scope=ldap3.SUBTREE, search_filter="(&(objectClass=posixGroup)(cn={})(memberuid={}))".    format("qa", "klemen"))

ldap-test-server's People

Contributors

rokcarl avatar pka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.