From 5274e12c7cc19451355082418f78004c4d97e263 Mon Sep 17 00:00:00 2001 From: Dariusz Bywalec Date: Mon, 4 Jan 2016 11:32:58 +0100 Subject: 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. --- src/main/java/com/gitblit/manager/AuthenticationManager.java | 6 ++++++ 1 file changed, 6 insertions(+) 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)) { -- cgit v1.2.3