def __try_auth_ldap(self, auth_string): """ Try to authenticate user to all the configured authorities. """ if self.__is_method_enabled("ldap"): username, password = auth_string.split(":") ldap_authorities = self.__auth_config["method_ldap"] \ .get("authorities") for ldap_conf in ldap_authorities: if cc_ldap.auth_user(ldap_conf, username, password): groups = cc_ldap.get_groups(ldap_conf, username, password) return {'username': username, 'groups': groups} return False
def __try_auth_ldap(self, auth_string): """ Try to authenticate user to all the configured authorities. """ if self.__is_method_enabled('ldap'): username, password = auth_string.split(':') ldap_authorities = self.__auth_config['method_ldap'] \ .get('authorities') for ldap_conf in ldap_authorities: if cc_ldap.auth_user(ldap_conf, username, password): groups = cc_ldap.get_groups(ldap_conf, username, password) self.__update_groups(username, groups) return {'username': username, 'groups': groups} return False