##// END OF EJS Templates
auth: add better logging for ldap related attributes to help track problems
marcink -
r3271:e84f17fa default
parent child Browse files
Show More
@@ -53,7 +53,7 b' class LdapError(Exception):'
53 pass
53 pass
54
54
55
55
56 def plugin_factory(plugin_id, *args, **kwds):
56 def plugin_factory(plugin_id, *args, **kwargs):
57 """
57 """
58 Factory function that is called during plugin discovery.
58 Factory function that is called during plugin discovery.
59 It returns the plugin instance.
59 It returns the plugin instance.
@@ -142,7 +142,7 b' class AuthLdap(AuthLdapBase):'
142 ldap_conn.start_tls_s()
142 ldap_conn.start_tls_s()
143
143
144 if self.LDAP_BIND_DN and self.LDAP_BIND_PASS:
144 if self.LDAP_BIND_DN and self.LDAP_BIND_PASS:
145 log.debug('Trying simple_bind with password and given login DN: %s',
145 log.debug('Trying simple_bind with password and given login DN: %r',
146 self.LDAP_BIND_DN)
146 self.LDAP_BIND_DN)
147 ldap_conn.simple_bind_s(self.LDAP_BIND_DN, self.LDAP_BIND_PASS)
147 ldap_conn.simple_bind_s(self.LDAP_BIND_DN, self.LDAP_BIND_PASS)
148
148
@@ -150,7 +150,7 b' class AuthLdap(AuthLdapBase):'
150
150
151 def fetch_attrs_from_simple_bind(self, server, dn, username, password):
151 def fetch_attrs_from_simple_bind(self, server, dn, username, password):
152 try:
152 try:
153 log.debug('Trying simple bind with %s', dn)
153 log.debug('Trying simple bind with %r', dn)
154 server.simple_bind_s(dn, safe_str(password))
154 server.simple_bind_s(dn, safe_str(password))
155 user = server.search_ext_s(
155 user = server.search_ext_s(
156 dn, ldap.SCOPE_BASE, '(objectClass=*)', )[0]
156 dn, ldap.SCOPE_BASE, '(objectClass=*)', )[0]
@@ -502,6 +502,7 b' class RhodeCodeAuthPlugin(RhodeCodeExter'
502 extern_type = getattr(userobj, 'extern_type', '')
502 extern_type = getattr(userobj, 'extern_type', '')
503
503
504 groups = []
504 groups = []
505
505 user_attrs = {
506 user_attrs = {
506 'username': username,
507 'username': username,
507 'firstname': safe_unicode(get_ldap_attr('attr_firstname') or firstname),
508 'firstname': safe_unicode(get_ldap_attr('attr_firstname') or firstname),
General Comments 0
You need to be logged in to leave comments. Login now