diff --git a/kallithea/lib/auth_modules/auth_internal.py b/kallithea/lib/auth_modules/auth_internal.py --- a/kallithea/lib/auth_modules/auth_internal.py +++ b/kallithea/lib/auth_modules/auth_internal.py @@ -67,6 +67,9 @@ class KallitheaAuthPlugin(auth_modules.K log.warning("userobj:%s extern_type mismatch got:`%s` expected:`%s`", userobj, userobj.extern_type, self.name) return None + if not username: + log.debug('Empty username - skipping...') + return None user_data = { "username": userobj.username, diff --git a/kallithea/lib/auth_modules/auth_pam.py b/kallithea/lib/auth_modules/auth_pam.py --- a/kallithea/lib/auth_modules/auth_pam.py +++ b/kallithea/lib/auth_modules/auth_pam.py @@ -85,6 +85,9 @@ class KallitheaAuthPlugin(auth_modules.K return True def auth(self, userobj, username, password, settings, **kwargs): + if not username: + log.debug('Empty username - skipping...') + return None if username not in _auth_cache: # Need lock here, as PAM authentication is not thread safe _pam_lock.acquire()