]> source.dussan.org Git - gitblit.git/commitdiff
Fix authentication failure warning log messages for FEDERATION_USER 990/head
authorDariusz Bywalec <dariusz.bywalec@trapezegroup.pl>
Mon, 4 Jan 2016 10:32:58 +0000 (11:32 +0100)
committerDariusz Bywalec <dariusz.bywalec@trapezegroup.pl>
Mon, 4 Jan 2016 10:32:58 +0000 (11:32 +0100)
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

index f092bfede7d670331f33993b5d13f982d1d23400..0d7e9274fd22ab09cadd00c5cceb7df0f15e0257 100644 (file)
@@ -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)) {