diff options
Diffstat (limited to 'src/saml2/userinfo/ldapinfo.py')
-rw-r--r-- | src/saml2/userinfo/ldapinfo.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/saml2/userinfo/ldapinfo.py b/src/saml2/userinfo/ldapinfo.py index 17b0905a..085c9102 100644 --- a/src/saml2/userinfo/ldapinfo.py +++ b/src/saml2/userinfo/ldapinfo.py @@ -1,11 +1,13 @@ import ldap from ldap import SCOPE_SUBTREE + from saml2.userinfo import UserInfo class UserInfoLDAP(UserInfo): - def __init__(self, uri, base, filter_pattern, scope=SCOPE_SUBTREE, - tls=False, user="", passwd="", attr=None, attrsonly=False): + def __init__( + self, uri, base, filter_pattern, scope=SCOPE_SUBTREE, tls=False, user="", passwd="", attr=None, attrsonly=False + ): UserInfo.__init__(self) self.ldapuri = uri self.base = base @@ -18,8 +20,9 @@ class UserInfoLDAP(UserInfo): self.ld.protocol_version = ldap.VERSION3 self.ld.simple_bind_s(user, passwd) - def __call__(self, userid, base="", filter_pattern="", scope=SCOPE_SUBTREE, - tls=False, attr=None, attrsonly=False, **kwargs): + def __call__( + self, userid, base="", filter_pattern="", scope=SCOPE_SUBTREE, tls=False, attr=None, attrsonly=False, **kwargs + ): if filter_pattern: _filter = filter_pattern % userid @@ -34,4 +37,4 @@ class UserInfoLDAP(UserInfo): res = self.ld.search_s(*arg) # should only be one entry and the information per entry is # the tuple (dn, ava) - return res[0][1]
\ No newline at end of file + return res[0][1] |