Commit 85c0c262 authored by Jérome Perrin's avatar Jérome Perrin

ERP5Security: log errors from authentication policy

because PAS only log these errors with level debug (
https://github.com/zopefoundation/Products.PluggableAuthService/blob/0fc22e9c472ba514470a9b205c945eb62df12205/Products/PluggableAuthService/PluggableAuthService.py#L663
) they remained unnoticed in our case
parent 974efb78
......@@ -191,18 +191,24 @@ class ERP5UserManager(BasePlugin):
return None
user = user_list[0]
if authentication_result is None:
# file a failed authentication attempt
user.notifyLoginFailure()
return None
try:
if authentication_result is None:
# file a failed authentication attempt
user.notifyLoginFailure()
return None
# check if password is expired
if user.isPasswordExpired():
user.notifyPasswordExpire()
return None
# check if password is expired
if user.isPasswordExpired():
user.notifyPasswordExpire()
return None
# check if user account is blocked
if user.isLoginBlocked():
# check if user account is blocked
if user.isLoginBlocked():
return None
except ConflictError:
raise
except Exception, e:
LOG('ERP5Security', PROBLEM, 'Error when processing authentication policy', error=sys.exc_info())
return None
return authentication_result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment