Skip to content

Use LDAP/Active Directory Functionality like Authenticating User/ Fetch User Details with help of APIs

License

Notifications You must be signed in to change notification settings

r4rajat/LDAP-Wrapper-APIs

Repository files navigation

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)

About

Use LDAP/Active Directory Functionality like Authenticating User/ Fetch User Details with help of APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages