summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDariusz Bywalec <dariusz.bywalec@trapezegroup.pl>2016-01-04 11:32:58 +0100
committerDariusz Bywalec <dariusz.bywalec@trapezegroup.pl>2016-01-04 11:32:58 +0100
commit5274e12c7cc19451355082418f78004c4d97e263 (patch)
tree965bdcad1bd24c5288cb25d1f8a0dc79bd0288c6
parent2539ceea0d47467d54cedd340afa6ede2909b2bd (diff)
downloadgitblit-5274e12c7cc19451355082418f78004c4d97e263.tar.gz
gitblit-5274e12c7cc19451355082418f78004c4d97e263.zip
Fix authentication failure warning log messages for FEDERATION_USER
The AuthenticationManager did not encounter for FEDERATION_USER and would unnecessarily generate a lot of failure warning log messages, e.g: Failed login attempt for $gitblit, invalid credentials from XXX.XX.XX.XX A simple condition will prematurely return null bypassing the regular authentication path and immediately make the authentication be routed via FederationManager.
-rw-r--r--src/main/java/com/gitblit/manager/AuthenticationManager.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/manager/AuthenticationManager.java b/src/main/java/com/gitblit/manager/AuthenticationManager.java
index f092bfed..0d7e9274 100644
--- a/src/main/java/com/gitblit/manager/AuthenticationManager.java
+++ b/src/main/java/com/gitblit/manager/AuthenticationManager.java
@@ -466,6 +466,12 @@ public class AuthenticationManager implements IAuthenticationManager {
return null;
}
+ if (username.equalsIgnoreCase(Constants.FEDERATION_USER)) {
+ // can not authenticate internal FEDERATION_USER at this point
+ // it must be routed to FederationManager
+ return null;
+ }
+
String usernameDecoded = StringUtils.decodeUsername(username);
String pw = new String(password);
if (StringUtils.isEmpty(pw)) {