Skip to content

Instantly share code, notes, and snippets.

View nqthqn's full-sized avatar
🍐
pear programming

Nate nqthqn

🍐
pear programming
View GitHub Profile
@nqthqn
nqthqn / auth.py
Created August 28, 2014 20:14 — forked from ibeex/auth.py
import ldap
def check_credentials(username, password):
"""Verifies credentials for username and password.
Returns None on success or a string describing the error on failure
# Adapt to your needs
"""
LDAP_SERVER = 'ldap://xxx'
# fully qualified AD user name
LDAP_USERNAME = '%[email protected]' % username