Skip to content

Latest commit

 

History

History
59 lines (50 loc) · 1.32 KB

README.md

File metadata and controls

59 lines (50 loc) · 1.32 KB

LDAP Wrapper for AD Authentication through APIs


Step 1: Install Requirements to Run Application

$ pip3 install -r requirements.txt
NOTE: If getting error while installing pyldap follow the step below
$ sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev -y

Step 2: Setup Environmental Variables

$ nano ~/.bashrc

Add following Environmental Variables to your .bashrc file

export AUTH_AD_HOST="IP of your AD Server/Host"
export AUTH_AD_PORT="AD Server/Host Port"
export AUTH_AD_DOMAIN="AD Domain"
export AUTH_AD_DN="Search Path in the Tree"
# Details of Bind User 
export AUTH_AD_USERNAME="Username of Bind User"
export AUTH_AD_PASSWORD="Password of Bind User in Base64 encooding"

Step 3: Run the Python Application

$ python3 app.py

API Documentation


Host: localhost(Default)
Port: 5000(Default)
Login / Check Credentials / Authenticating User
API: /api/ldap/login
Method: GET
Params:
    - username: Username of User (XX-xxxx)
    - password: Password of User in base64 encoding
Fetch User Information
API: /api/ldap/details
Method: GET
Params:
    - username: Username of User (XX-xxxx)