From 0b4fadedd2d7ffbb58598d9844e1c7d97cabc447 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 28 Aug 2020 17:58:13 +0200 Subject: [PATCH] feat: log ldap error messages on invalid-credentials --- src/Auth/LDAP.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Auth/LDAP.hs b/src/Auth/LDAP.hs index ec0822c0a..007178793 100644 --- a/src/Auth/LDAP.hs +++ b/src/Auth/LDAP.hs @@ -203,7 +203,11 @@ campusLogin pool mode = AuthPlugin{..} $logErrorS apName $ "Error during login: " <> tshow err observeLoginOutcome apName LoginError loginErrorMessageI LoginR Msg.AuthError - Right (Left _bindErr) -> do + Right (Left bindErr) -> do + case bindErr of + Ldap.ResponseErrorCode _ _ _ errTxt -> + $logInfoS apName [st|#{campusIdent}: #{errTxt}|] + _other -> return () $logDebugS apName "Invalid credentials" observeLoginOutcome apName LoginInvalidCredentials loginErrorMessageI LoginR Msg.InvalidLogin